java.lang.Object
javax.swing.AbstractAction
org.autogui.swing.GuiSwingTaskRunner.ContextAction
org.autogui.swing.GuiSwingActionDefault.ExecutionAction
- All Implemented Interfaces:
ActionListener,Serializable,Cloneable,EventListener,Action,GuiSwingKeyBinding.RecommendedKeyStroke,PopupCategorized.CategorizedMenuItem,PopupCategorized.CategorizedMenuItemAction,PopupCategorized.CategorizedMenuItemComponent
- Direct Known Subclasses:
GuiSwingTableColumnSetDefault.TableSelectionListAction
- Enclosing class:
GuiSwingActionDefault
public static class GuiSwingActionDefault.ExecutionAction
extends GuiSwingTaskRunner.ContextAction
implements PopupCategorized.CategorizedMenuItemAction, GuiSwingKeyBinding.RecommendedKeyStroke
a swing-action executing the action of the context.
the icon will be automatically determined by the name of the context via
GuiSwingIcons- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringthe message of the confirmation dialog showen whenneedToConfirmprotected booleanif true, the action shows a confirmation dialog before executingprotected AtomicBooleanprotected GuiSwingView.SpecifierManagerFields inherited from class org.autogui.swing.GuiSwingTaskRunner.ContextAction
taskRunnerFields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON -
Constructor Summary
ConstructorsConstructorDescriptionExecutionAction(GuiMappingContext context, GuiSwingView.SpecifierManager targetSpecifier) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidexecuteAction(GuiReprValue.ObjectSpecifier specifier) executeAction(GuiReprValue.ObjectSpecifier specifier, ActionEvent e) voidexecuteWithConfirm(ActionEvent e, Runnable action, Runnable cancelAction) the void returning version ofexecuteWithConfirmReturn(ActionEvent, Supplier, Supplier)<RetType> RetTypeexecuteWithConfirmReturn(ActionEvent e, Supplier<RetType> action, Supplier<RetType> cancelAction) show a confirmation dialog and run the action if the user selects OK of the dialoggetIcon()protected voidsetneedToConfirmandconfirmDescriptionfrom init-annotation attached to the action methodvoidsetResultTarget(Consumer<Object> resultTarget) Methods inherited from class org.autogui.swing.GuiSwingTaskRunner.ContextAction
executeContextTask, executeContextTask, getContextMethods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabledMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.swing.Action
accept, addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabledMethods inherited from interface org.autogui.swing.util.PopupCategorized.CategorizedMenuItem
getKeyStroke, getSubCategoryMethods inherited from interface org.autogui.swing.util.PopupCategorized.CategorizedMenuItemAction
getMenuItem, getMenuItemWithAction, remapMethods inherited from interface org.autogui.swing.util.PopupCategorized.CategorizedMenuItemComponent
getCategory, getName
-
Field Details
-
resultTarget
-
running
-
targetSpecifier
-
needToConfirm
protected boolean needToConfirmif true, the action shows a confirmation dialog before executing- Since:
- 1.8
-
confirmDescription
the message of the confirmation dialog showen whenneedToConfirm- Since:
- 1.8
-
-
Constructor Details
-
ExecutionAction
-
-
Method Details
-
initNeedToConfirmDefault
protected void initNeedToConfirmDefault()setneedToConfirmandconfirmDescriptionfrom init-annotation attached to the action method- Since:
- 1.8
-
setResultTarget
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener- Overrides:
actionPerformedin classGuiSwingTaskRunner.ContextAction
-
actionPerformedWithoutCheckingRunning
-
getIconName
-
executeWithConfirm
the void returning version ofexecuteWithConfirmReturn(ActionEvent, Supplier, Supplier)- Parameters:
e- the action-event used for showing the confirmation dialogaction- the action code body; non-nullcancelAction- the action executed when the user selects canceling, or null- Since:
- 1.8
-
executeWithConfirmReturn
public <RetType> RetType executeWithConfirmReturn(ActionEvent e, Supplier<RetType> action, Supplier<RetType> cancelAction) show a confirmation dialog and run the action if the user selects OK of the dialog- Type Parameters:
RetType- the returned type of the action- Parameters:
e- the action-event used for showing the confirmation dialog; obtaining the root-pane of a source component and used for the dialog parentaction- the action code body; non-nullcancelAction- the action when cancelled ; non-null- Returns:
- the returned value of the action (or calcelAction)
- Since:
- 1.8
-
executeAction
-
executeAction
- Parameters:
specifier- a specifier for the target objecte- an optional action event- Since:
- 1.8
-
getIcon
- Specified by:
getIconin interfacePopupCategorized.CategorizedMenuItem- Specified by:
getIconin interfacePopupCategorized.CategorizedMenuItemComponent
-
getActionPressedIcon
-
getRecommendedKeyStroke
- Specified by:
getRecommendedKeyStrokein interfaceGuiSwingKeyBinding.RecommendedKeyStroke
-
getRecommendedKeyPrecedence
- Specified by:
getRecommendedKeyPrecedencein interfaceGuiSwingKeyBinding.RecommendedKeyStroke
-