public abstract class AbstractToggleState extends VisibleState
manager, properties, propertyChangeSupport
ACTIVATION_PROPERTY, ACTIVE_ICON_PROPERTY, DISABLED_ICON_PROPERTY, ENABLE_PROPERTY, INACTIVE_ICON_PROPERTY, LABEL_TEXT_PROPERTY, POPUP_PROPERTY, TOOLTIP_TEXT_PROPERTY
Modifier | Constructor and Description |
---|---|
protected |
AbstractToggleState(java.lang.String baseTag)
Create a visible state from I18n settings.
|
protected |
AbstractToggleState(java.lang.String labelResourceKey,
java.lang.String tooltipResourceKey,
javax.swing.Icon activeIcon)
Create a visible state with default icons.
|
protected |
AbstractToggleState(java.lang.String labelResourceKey,
java.lang.String tooltipResourceKey,
javax.swing.ImageIcon activeIcon,
javax.swing.ImageIcon inactiveIcon,
javax.swing.ImageIcon disabledIcon)
Create a visible state.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
An action is performed.
|
void |
deactivate()
Deactivate this state.
|
boolean |
isToggleEnabled()
Is it possible to switch this state off by clicking on it with the mouse?
|
getLocale, setLocale
activate, addPropertyChangeListener, addPropertyChangeListener, addToToolBar, addToToolBar, getValue, isActivated, isEnabled, putValue, refresh, removePropertyChangeListener, removePropertyChangeListener, setEnabled, setManager, setProperty, showPopup
protected AbstractToggleState(java.lang.String labelResourceKey, java.lang.String tooltipResourceKey, javax.swing.ImageIcon activeIcon, javax.swing.ImageIcon inactiveIcon, javax.swing.ImageIcon disabledIcon)
labelResourceKey
- resource key for labels and menu itemstooltipResourceKey
- resource key for tooltipsactiveIcon
- icon to be displayed when state is activeinactiveIcon
- icon to be displayed when state is inactivedisabledIcon
- icon to be displayed when state is disabled
(if null
the Swing standard is used)protected AbstractToggleState(java.lang.String labelResourceKey, java.lang.String tooltipResourceKey, javax.swing.Icon activeIcon)
labelResourceKey
- resource key for labels and menu itemstooltipResourceKey
- resource key for tooltipsactiveIcon
- icon to be displayed when state is activeprotected AbstractToggleState(@NotNull java.lang.String baseTag)
baseTag
- I18n base tagpublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
actionPerformed
in class AbstractState
e
- unusedpublic void deactivate()
deactivate
in interface State
deactivate
in class AbstractState
public boolean isToggleEnabled()
isToggleEnabled
in interface State
isToggleEnabled
in class AbstractState