Class GeneiousAction.ToggleAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- com.biomatters.geneious.publicapi.plugin.GeneiousAction
-
- com.biomatters.geneious.publicapi.plugin.GeneiousAction.ToggleAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
- Enclosing class:
- GeneiousAction
public abstract static class GeneiousAction.ToggleAction extends GeneiousAction
A subclass of GeneiousAction which is placed in a toolbar/menu as a toggle button or check box menu item.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.biomatters.geneious.publicapi.plugin.GeneiousAction
GeneiousAction.Divider, GeneiousAction.SubMenu, GeneiousAction.ToggleAction
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
TOGGLED_PROPERTY_NAME
The name of the property for which a propertyChange event is fired when the action is toggled-
Fields inherited from class com.biomatters.geneious.publicapi.plugin.GeneiousAction
DESC, ICON, NAME
-
-
Constructor Summary
Constructors Modifier Constructor Description ToggleAction(GeneiousAction.ToggleAction internalAction)
Creates a ToggleAction that wraps another toggle action.protected
ToggleAction(GeneiousActionOptions actionOptions)
Construct a Toggle action with its properties specified by the GeneiousActionOptions
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
abstract void
actionToggled(java.awt.event.ActionEvent e, boolean isSelected)
Called when the action is performed, indicating that the selected state of the action has changed.boolean
isSelected()
Whether or not this action is selectedvoid
setSelected(boolean isSelected)
Set the selected state of the action-
Methods inherited from class com.biomatters.geneious.publicapi.plugin.GeneiousAction
asMenuItem, asToolbarButton, equals, getActionsInMainMenuOrder, getActionsInPopupMenuOrder, getActionsInToolbarOrder, getCategory, getDescription, getIcon16, getIcon24, getIcon32, getIdentifier, getKeys, getMainMenuLocation, getMainMenuLocations, getName, getOptions, getShortcut, getValue, hashCode, isEnabled, isInMainToolbar, isInPopupMenu, isProOnly, isSearchable, setDescription, setEnabled, setIcons, setInMainToolbar, setInMainToolbar, setInPopupMenu, setInPopupMenu, setMainMenuLocation, setMainMenuLocation, setMainMenuLocations, setName, setProOnly, setSearchable, setShortcutKey, toString
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getPropertyChangeListeners, putValue, removePropertyChangeListener
-
-
-
-
Field Detail
-
TOGGLED_PROPERTY_NAME
public static final java.lang.String TOGGLED_PROPERTY_NAME
The name of the property for which a propertyChange event is fired when the action is toggled- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ToggleAction
protected ToggleAction(GeneiousActionOptions actionOptions)
Construct a Toggle action with its properties specified by the GeneiousActionOptions- Parameters:
actionOptions
- GeneiousActionOptions specifying the properties of this action.
-
ToggleAction
public ToggleAction(GeneiousAction.ToggleAction internalAction)
Creates a ToggleAction that wraps another toggle action. This action's implementation of actionToggled must include the following two lines:internalAction.setSelected(isSelected); internalAction.actionToggled(e, isSelected);
- Parameters:
internalAction
- the internal ToggleAction that all methods are delegated to.
-
-
Method Detail
-
isSelected
public boolean isSelected()
Whether or not this action is selected- Returns:
- true if the action is selected (checked if a check-box menu item, toggled on if a button), false otherwise
-
setSelected
public void setSelected(boolean isSelected)
Set the selected state of the action- Parameters:
isSelected
- true to have the action selected (checked if a check-box menu item, toggled on if a button), false otherwise.
-
actionPerformed
public final void actionPerformed(java.awt.event.ActionEvent e)
-
actionToggled
public abstract void actionToggled(java.awt.event.ActionEvent e, boolean isSelected)
Called when the action is performed, indicating that the selected state of the action has changed.- Parameters:
e
- ActionEvent fired by the componentisSelected
- the new selection state of the action
-
-