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 java.lang.Object
A specification of a button that should be added to the options dialog
-
-
Field Summary
Fields Modifier and Type Field Description private booleanenabledjava.lang.StringhelpTopicThe help topic to linkjavax.swing.Iconiconthe icon to display.private java.util.Collection<javax.swing.event.ChangeListener>listenersjava.lang.Stringtextthe button textjava.lang.StringtooltipTextThe tooltip to display when hovering the button
-
Constructor Summary
Constructors Constructor Description ButtonSpec(java.lang.String text, javax.swing.Icon icon, java.lang.String tooltipText, java.lang.String helpTopic)Constructs a newButtonSpec.ButtonSpec(java.lang.String text, javax.swing.Icon icon, java.lang.String tooltipText, java.lang.String helpTopic, boolean enabled)Constructs a newButtonSpec.ButtonSpec(java.lang.String text, ImageProvider imageProvider, java.lang.String tooltipText, java.lang.String helpTopic)Constructs a newButtonSpec.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleanaddChangeListener(javax.swing.event.ChangeListener listener)booleanisEnabled()Determines if this button spec is enabledvoidsetEnabled(boolean enabled)Enables or disables this button spec, depending on the value of the parameterb.
-
-
-
Field Detail
-
text
public final java.lang.String text
the button text
-
icon
public final javax.swing.Icon icon
the icon to display. Can benull
-
tooltipText
public final java.lang.String tooltipText
The tooltip to display when hovering the button
-
helpTopic
public final java.lang.String helpTopic
The help topic to link
-
enabled
private boolean enabled
-
listeners
private final java.util.Collection<javax.swing.event.ChangeListener> listeners
-
-
Constructor Detail
-
ButtonSpec
public ButtonSpec(java.lang.String text, ImageProvider imageProvider, java.lang.String tooltipText, java.lang.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(java.lang.String text, javax.swing.Icon icon, java.lang.String tooltipText, java.lang.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(java.lang.String text, javax.swing.Icon icon, java.lang.String tooltipText, java.lang.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:
trueif this button spec is enabled,falseotherwise- 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(javax.swing.event.ChangeListener listener)
-
-