- java.lang.Object
- 
- javax.swing.AbstractAction
- 
- com.iamsoft.util.ui.swing.activation.AbstractActivateableAction
- 
- com.iamsoft.util.ui.swing.SwingAction
 
 
 
- 
- All Implemented Interfaces:
- Activatable,- ActionListener,- Serializable,- Cloneable,- EventListener,- Action
 - Direct Known Subclasses:
- CascadeWindowAction,- CheckForUpdateAction,- DataRequestAction,- DisplayDisablementExplanationAction,- EvalScriptAction,- GoToSnapshotAction,- HelpContentsAction,- HelpIndexAction,- HelpSearchAction,- HistoryAction,- LaunchWindowDialogWindowAction,- Log4jPrefsAction,- RedoAction,- SwingWorkersAction,- ThreadPrefsAction,- TileHorizontallyWindowAction,- TileVerticallyWindowAction,- UndoAction
 
 public abstract class SwingAction extends AbstractActivateableAction Wraps actions so that enablement and errors can be more easily handled. If the wrapped ActionListener.actionPerformed(ActionEvent) throws an exception, the decorator will catch the error and display a friendly dialog. If any other class has reason to disable the action, the decorator can add it to a list and ensure that the action remains disabled until the list is empty. This approach should greatly simplify disablements that occur because of busy threads. In general, the underlying action should always be enabled.- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringELIPSISString suffix that indicates that an action requires further input from a user prior to completion.- 
Fields inherited from class javax.swing.AbstractActionchangeSupport, enabled
 - 
Fields inherited from interface javax.swing.ActionACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedSwingAction()protectedSwingAction(String pText)protectedSwingAction(String pText, Icon pIcon)
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(ActionEvent pEvt)Try to perform wrapped action.protected voidaddElipsis()static SwingActiondecorateAction(Action pAction)Wrap an ordinary action in a SwingAction.abstract voidexecute()Perform action.protected intgetModifiers()- 
Methods inherited from class com.iamsoft.util.ui.swing.activation.AbstractActivateableActionaddActivationCriterion, getActivatableFacade, isDisplayingDisablementReasonsByDefault, isDisplayingDisablementReasonsByOverride, putValue, setDisplayingDisablementReasonsByDefault, setEnabled, stripTooltip
 - 
Methods inherited from class javax.swing.AbstractActionaddPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, removePropertyChangeListener
 
- 
 
- 
- 
- 
Field Detail- 
ELIPSISpublic static final String ELIPSIS String suffix that indicates that an action requires further input from a user prior to completion.- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
SwingActionprotected SwingAction() 
 - 
SwingActionprotected SwingAction(String pText) - See Also:
- SwingAction(String, Icon)
 
 
- 
 - 
Method Detail- 
getModifiersprotected int getModifiers() 
 - 
decorateActionpublic static SwingAction decorateAction(Action pAction) Wrap an ordinary action in a SwingAction. The wrapped action's "actionPerformed" method must be able to accept a null parameter.- Parameters:
- pAction- Wrapped action.
- Returns:
- A SwingAction that wraps an ordinary action.
 
 - 
actionPerformedpublic final void actionPerformed(ActionEvent pEvt) Try to perform wrapped action. On error, display a dialog.
 - 
addElipsisprotected void addElipsis() 
 - 
executepublic abstract void execute() Perform action.
 
- 
 
-