Package com.nomagic.actions
Class NMTriStateAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- com.nomagic.actions.NMAction
-
- com.nomagic.actions.BaseNMStateAction
-
- com.nomagic.actions.NMTriStateAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable
,java.util.EventListener
,javax.swing.Action
- Direct Known Subclasses:
MDTriStateAction
@OpenApiAll public class NMTriStateAction extends BaseNMStateAction
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NMTriStateAction.ACTION_STATE
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
TRI_STATE
The state property.-
Fields inherited from class com.nomagic.actions.BaseNMStateAction
GROUPED
-
Fields inherited from class com.nomagic.actions.NMAction
ACTION_SHORTCUTS, BELONGS_TO_SEPARATE_GROUP_IN_UI, DO_NO_SHOW_ACTION_NAME_IN_UI, DO_NOT_REGISTER_ACTION_TO_COMPONENTS, GENERATED_ID_PREFIX, GROUP, ID, LARGE_ICON, MENU_SHORTCUT_MASK, TINY_ICON
-
-
Constructor Summary
Constructors Constructor Description NMTriStateAction(java.lang.String id, java.lang.String name, int mnemonic)
NMTriStateAction(java.lang.String id, java.lang.String name, int mnemonic, java.lang.String group)
NMTriStateAction(java.lang.String id, java.lang.String name, javax.swing.KeyStroke stroke)
NMTriStateAction(java.lang.String id, java.lang.String name, javax.swing.KeyStroke stroke, java.lang.String group)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(ActionsVisitor visitor)
Accepts ActionsVisitor using Visitor design pattern.void
actionPerformed(java.awt.event.ActionEvent e)
Executes given action.NMTriStateAction.ACTION_STATE
getState()
void
setMixedIconSupplier(java.util.function.Supplier<javax.swing.Icon> mixedIconSupplier)
void
setSelectedIconSupplier(java.util.function.Supplier<javax.swing.Icon> selectedIconSupplier)
void
setState(NMTriStateAction.ACTION_STATE state)
Sets action String state.void
setUnselectedIconSupplier(java.util.function.Supplier<javax.swing.Icon> unselectedIconSupplier)
-
Methods inherited from class com.nomagic.actions.BaseNMStateAction
isGrouped, setGrouped
-
Methods inherited from class com.nomagic.actions.NMAction
addAction, addPropertyChangeListener, addShortcut, addShotcut, addWeakPropertyChangeListener, clone, compareTo, createMenuItem, equals, firePropertyChange, forEach, forEachIncludingSelf, getActions, getCommandKey, getDescription, getGroup, getIcon, getID, getLargeIcon, getLargeOrSmallIcon, getMenuShortcutMaskAsString, getMnemonicKey, getName, getPropertyChangeListeners, getShortcuts, getSmallIcon, getSmallOrLargeIcon, getTinyIcon, hashCode, hasMenuShortcutMask, isIDGenerated, removeAction, removeIf, removePropertyChangeListener, removeShortcut, removeWeakPropertyChangeListener, setActions, setDescription, setGroup, setIcon, setLargeIcon, setMnemonicKey, setName, setShortcuts, setSmallIcon, setTinyIcon, shallowClone, toString, updateState
-
Methods inherited from class javax.swing.AbstractAction
getKeys, getValue, isEnabled, putValue, setEnabled
-
-
-
-
Field Detail
-
TRI_STATE
public static final java.lang.String TRI_STATE
The state property. Value of this property is an enumeration- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NMTriStateAction
public NMTriStateAction(@CheckForNull java.lang.String id, @CheckForNull java.lang.String name, @CheckForNull javax.swing.KeyStroke stroke, @CheckForNull java.lang.String group)
-
NMTriStateAction
public NMTriStateAction(@CheckForNull java.lang.String id, @CheckForNull java.lang.String name, int mnemonic, @CheckForNull java.lang.String group)
-
NMTriStateAction
public NMTriStateAction(@CheckForNull java.lang.String id, @CheckForNull java.lang.String name, @CheckForNull javax.swing.KeyStroke stroke)
-
NMTriStateAction
public NMTriStateAction(@CheckForNull java.lang.String id, @CheckForNull java.lang.String name, int mnemonic)
-
-
Method Detail
-
setState
public void setState(NMTriStateAction.ACTION_STATE state)
Sets action String state.- Parameters:
state
- new state of action.
-
getState
public NMTriStateAction.ACTION_STATE getState()
- Returns:
- the state of the action
-
setMixedIconSupplier
public void setMixedIconSupplier(java.util.function.Supplier<javax.swing.Icon> mixedIconSupplier)
-
setSelectedIconSupplier
public void setSelectedIconSupplier(java.util.function.Supplier<javax.swing.Icon> selectedIconSupplier)
-
setUnselectedIconSupplier
public void setUnselectedIconSupplier(java.util.function.Supplier<javax.swing.Icon> unselectedIconSupplier)
-
actionPerformed
public void actionPerformed(@CheckForNull java.awt.event.ActionEvent e)
Executes given action.- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
- Specified by:
actionPerformed
in classNMAction
- Parameters:
e
- event caused execution.
-
accept
public void accept(ActionsVisitor visitor)
Accepts ActionsVisitor using Visitor design pattern.
-
-