Package org.openstreetmap.josm.gui
Class HelpAwareOptionPane.ButtonSpec
java.lang.Object
org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec
- Enclosing class:
- HelpAwareOptionPane
A specification of a button that should be added to the options dialog
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanfinal StringThe help topic to linkfinal Iconthe icon to display.private final Collection<ChangeListener>final Stringthe button textfinal StringThe tooltip to display when hovering the button -
Constructor Summary
ConstructorsConstructorDescriptionButtonSpec(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
Modifier and TypeMethodDescriptionprivate booleanaddChangeListener(ChangeListener listener) final booleanDetermines if this button spec is enabledfinal voidsetEnabled(boolean enabled) Enables or disables this button spec, depending on the value of the parameterb.
-
Field Details
-
text
the button text -
icon
the icon to display. Can benull -
tooltipText
The tooltip to display when hovering the button -
helpTopic
The help topic to link -
enabled
-
listeners
-
-
Constructor Details
-
ButtonSpec
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
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
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 Details
-
isEnabled
Determines if this button spec is enabled- Returns:
trueif this button spec is enabled,falseotherwise- Since:
- 6051
-
setEnabled
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
-