Package org.openstreetmap.josm.gui
Class HelpAwareOptionPane.ButtonSpec
- java.lang.Object
-
- org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec
-
- Enclosing class:
- HelpAwareOptionPane
public static class HelpAwareOptionPane.ButtonSpec extends Object
A specification of a button that should be added to the options dialog
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
enabled
String
helpTopic
The help topic to linkIcon
icon
the icon to display.private Collection<ChangeListener>
listeners
String
text
the button textString
tooltipText
The tooltip to display when hovering the button
-
Constructor Summary
Constructors Constructor Description ButtonSpec(String text, Icon icon, String tooltipText, String helpTopic)
Constructs a newButtonSpec
.ButtonSpec(String text, Icon icon, String tooltipText, String helpTopic, boolean enabled)
Constructs a newButtonSpec
.ButtonSpec(String text, ImageProvider imageProvider, String tooltipText, String helpTopic)
Constructs a newButtonSpec
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
addChangeListener(ChangeListener listener)
boolean
isEnabled()
Determines if this button spec is enabledvoid
setEnabled(boolean enabled)
Enables or disables this button spec, depending on the value of the parameterb
.
-
-
-
Field Detail
-
tooltipText
public final String tooltipText
The tooltip to display when hovering the button
-
enabled
private boolean enabled
-
listeners
private final Collection<ChangeListener> listeners
-
-
Constructor Detail
-
ButtonSpec
public ButtonSpec(String text, ImageProvider imageProvider, String tooltipText, String helpTopic)
Constructs a newButtonSpec
.- Parameters:
text
- the button textimageProvider
- provides the icon to display. Can be nulltooltipText
- the tooltip text. Can be null.helpTopic
- the help topic. Can be null.- Since:
- 13842
-
ButtonSpec
public ButtonSpec(String text, Icon icon, String tooltipText, String helpTopic)
Constructs a newButtonSpec
.- Parameters:
text
- the button texticon
- the icon to display. Can be nulltooltipText
- the tooltip text. Can be null.helpTopic
- the help topic. Can be null.
-
ButtonSpec
public ButtonSpec(String text, Icon icon, String tooltipText, String helpTopic, boolean enabled)
Constructs a newButtonSpec
.- Parameters:
text
- the button texticon
- the icon to display. Can be nulltooltipText
- the tooltip text. Can be null.helpTopic
- the help topic. Can be null.enabled
- the enabled status- Since:
- 5951
-
-
Method Detail
-
isEnabled
public final boolean isEnabled()
Determines if this button spec is enabled- Returns:
true
if this button spec is enabled,false
otherwise- Since:
- 6051
-
setEnabled
public final void setEnabled(boolean enabled)
Enables or disables this button spec, depending on the value of the parameterb
.- Parameters:
enabled
- iftrue
, this button spec is enabled; otherwise this button spec is disabled- Since:
- 6051
-
addChangeListener
private boolean addChangeListener(ChangeListener listener)
-
-