Package docking.menu
Class MultiStateDockingAction<T>
- java.lang.Object
-
- docking.action.DockingAction
-
- docking.menu.MultiStateDockingAction<T>
-
- Type Parameters:
T- the type of the user data
- All Implemented Interfaces:
DockingActionIf,HelpDescriptor
- Direct Known Subclasses:
NonToolbarMultiStateAction
public abstract class MultiStateDockingAction<T> extends DockingAction
An action that can be in one of multiple states. The button of this action has a drop-down icon that allows users to change the state of the button. Also, by default, as the user presses the button, it will execute the action corresponding to the current state.- See Also:
MultiActionDockingAction
-
-
Field Summary
-
Fields inherited from interface docking.action.DockingActionIf
DESCRIPTION_PROPERTY, ENABLEMENT_PROPERTY, GLOBALCONTEXT_PROPERTY, KEYBINDING_DATA_PROPERTY, MENUBAR_DATA_PROPERTY, POPUP_MENU_DATA_PROPERTY, TOOLBAR_DATA_PROPERTY
-
-
Constructor Summary
Constructors Modifier Constructor Description MultiStateDockingAction(java.lang.String name, java.lang.String owner)protectedMultiStateDockingAction(java.lang.String name, java.lang.String owner, boolean isToolbarAction)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(ActionContext context)method to actually perform the action logic for this action.abstract voidactionStateChanged(ActionState<T> newActionState, EventTrigger trigger)voidaddActionState(ActionState<T> actionState)protected voiddoActionPerformed(ActionContext context)This is the callback to be overridden when the child wishes to respond to user button presses that are on the button and not the drop-down.javax.swing.JButtondoCreateButton()java.util.List<ActionState<T>>getAllActionStates()ActionState<T>getCurrentState()TgetCurrentUserData()protected java.util.List<DockingActionIf>getStateActions()java.lang.StringgetTooTipText()voidsetActionStates(java.util.List<ActionState<T>> newStates)voidsetCurrentActionState(ActionState<T> actionState)voidsetCurrentActionStateByUserData(T t)voidsetCurrentActionStateWithTrigger(ActionState<T> actionState, EventTrigger trigger)voidsetGroup(java.lang.String group)voidsetMenuBarData(MenuData newMenuData)Sets the#MenuDatato be used to put this action on the tool's menu bar.voidsetPerformActionOnPrimaryButtonClick(boolean doPerformAction)If doPerformAction is true, then, when the user clicks the button and not the drop-down arrow, thedoActionPerformed(ActionContext)method will be called.voidsetPopupMenuData(MenuData newMenuData)Sets the#MenuDatato be used to put this action in the tool's popup menu.voidsetSubGroup(java.lang.String subGroup)protected voidsuperSetMenuBarData(MenuData newMenuData)-
Methods inherited from class docking.action.DockingAction
addPropertyChangeListener, createButton, createMenuItem, dispose, doCreateMenuItem, firePropertyChanged, getDefaultKeyBindingData, getDescription, getFullName, getHelpInfo, getHelpObject, getInceptionInformation, getKeyBinding, getKeyBindingData, getMenuBarData, getName, getOwner, getPopupMenuData, getToolBarData, isAddToPopup, isEnabled, isEnabledForContext, isKeyBindingManaged, isValidContext, isValidGlobalContext, markHelpUnnecessary, removePropertyChangeListener, setDescription, setEnabled, setHelpLocation, setKeyBindingData, setToolBarData, setUnvalidatedKeyBindingData, shouldAddToWindow, toString
-
-
-
-
Method Detail
-
actionStateChanged
public abstract void actionStateChanged(ActionState<T> newActionState, EventTrigger trigger)
-
setPerformActionOnPrimaryButtonClick
public void setPerformActionOnPrimaryButtonClick(boolean doPerformAction)
If doPerformAction is true, then, when the user clicks the button and not the drop-down arrow, thedoActionPerformed(ActionContext)method will be called. If doPerformAction is false, then, when the user clicks the button and not the drop-down arrow, the popup menu will be shown, just as if the user had clicked the drop-down arrow.Also, if the parameter is true, then the button will behave like a button in terms of mouse feedback. If false, then the button will behave more like a label.
-
actionPerformed
public final void actionPerformed(ActionContext context)
Description copied from interface:DockingActionIfmethod to actually perform the action logic for this action.- Specified by:
actionPerformedin interfaceDockingActionIf- Specified by:
actionPerformedin classDockingAction- Parameters:
context- theActionContextobject that provides information about where and how this action was invoked.
-
doActionPerformed
protected void doActionPerformed(ActionContext context)
This is the callback to be overridden when the child wishes to respond to user button presses that are on the button and not the drop-down. This will only be called ifperformActionOnPrimaryButtonClickis true.
-
getStateActions
protected java.util.List<DockingActionIf> getStateActions()
-
setGroup
public void setGroup(java.lang.String group)
-
setSubGroup
public void setSubGroup(java.lang.String subGroup)
-
addActionState
public void addActionState(ActionState<T> actionState)
-
setActionStates
public void setActionStates(java.util.List<ActionState<T>> newStates)
-
getCurrentUserData
public T getCurrentUserData()
-
getCurrentState
public ActionState<T> getCurrentState()
-
getAllActionStates
public java.util.List<ActionState<T>> getAllActionStates()
-
setCurrentActionStateByUserData
public void setCurrentActionStateByUserData(T t)
-
setCurrentActionState
public void setCurrentActionState(ActionState<T> actionState)
-
setCurrentActionStateWithTrigger
public void setCurrentActionStateWithTrigger(ActionState<T> actionState, EventTrigger trigger)
-
doCreateButton
public javax.swing.JButton doCreateButton()
- Overrides:
doCreateButtonin classDockingAction
-
setMenuBarData
public void setMenuBarData(MenuData newMenuData)
Description copied from class:DockingActionSets the#MenuDatato be used to put this action on the tool's menu bar.- Overrides:
setMenuBarDatain classDockingAction- Parameters:
newMenuData- the MenuData to be used to put this action on the tool's menu bar.
-
superSetMenuBarData
protected void superSetMenuBarData(MenuData newMenuData)
-
setPopupMenuData
public void setPopupMenuData(MenuData newMenuData)
Description copied from class:DockingActionSets the#MenuDatato be used to put this action in the tool's popup menu.- Overrides:
setPopupMenuDatain classDockingAction- Parameters:
newMenuData- the MenuData to be used to put this action on the tool's popup menu.
-
getTooTipText
public java.lang.String getTooTipText()
-
-