PATH |
EOAction
Inherits from: javax.swing.AbstractAction
Package: com.webobjects.eoapplication
Class Description
EOAction objects are abstract representations of operations the user can invoke from the user interface. An action does not specify how it appears in the user interface-it can appear as a button, a menu item, or both.
Each action defines a method called the action name, that is invoked when the action triggers. An action also has a description path, which describes the category of the action and its name. For example, a Quit action's description path might be "Document/Quit"
. In addition, the action can have a short description that differs from the last element of the description path, for example, "Quit the Application"
.
Actions can have icons for buttons in the application and small icons for minor buttons in the user interface. To allow users to trigger actions with "hot-keys," each action has a menu accelerator, a javax.swing.KeyStroke the user can type on the keyboard.
Actions often appear in groups in the user interface: buttons in the same group are rendered close together and menu items in the group are rendered in separate menus like the Document, Edit, Tools, or Window menus. To group actions, EOAction defines a category priority. All actions in the same group have the same category priority. An additional parameter, the action priority defines the order in which actions appear within a group (for example, the order menu items appear within a menu).
An action triggers when the user clicks the corresponding user interface widget. In most cases, the action's method is dispatched to the subcontrollers of the controller that displays the action. Methods whose names end with ...ForControllerHierarchy return such actions. In some cases, the action's method is dispatched to the active widget, like the text field containing the cursor. Methods whose names end with ...ForFocusComponent return such actions. In other cases, the action's method is dispatched to a particular object, usually the EOApplication at the root of the controller hierarchy.
EOAction defines methods to create actions, access an action's parameters, manage groups of actions, and accessing shared actions used in Direct to Java Client applications.
Constants
Constant | Description |
ActivatePreviousWindowActionPriority | Description forthcoming. |
AppendActionPriority | Description forthcoming. |
CancelActionPriority | Description forthcoming. |
ClearActionPriority | Description forthcoming. |
CloseWindowActionPriority | Description forthcoming. |
DeleteActionPriority | Description forthcoming. |
DescriptionPathSeparator | Description forthcoming. |
DocumentCategoryPriority | Description forthcoming. |
EditCategoryPriority | Description forthcoming. |
FindActionPriority | Description forthcoming. |
HelpActionPriority | Description forthcoming. |
HelpCategoryPriority | Description forthcoming. |
InfoActionPriority | Description forthcoming. |
InsertActionPriority | Description forthcoming. |
ModalActionsCategoryPriority | Description forthcoming. |
NavigationActionPriority | Description forthcoming. |
NavigationActionsCategoryPriority | Description forthcoming. |
NewMultipleWindowActionPriority | Description forthcoming. |
NewSingleWindowActionPriority | Description forthcoming. |
ObjectActionPriority | Description forthcoming. |
ObjectActionsCategoryPriority | Description forthcoming. |
OkayActionPriority | Description forthcoming. |
OpenActionPriority | Description forthcoming. |
PasteboardCopyActionPriority | Description forthcoming. |
PasteboardCutActionPriority | Description forthcoming. |
PasteboardDeleteActionPriority | Description forthcoming. |
PasteboardPasteActionPriority | Description forthcoming. |
PasteboardSelectAllActionPriority | Description forthcoming. |
QuitActionPriority | Description forthcoming. |
RedoActionPriority | Description forthcoming. |
RefreshActionPriority | Description forthcoming. |
RevertActionPriority | Description forthcoming. |
SaveActionPriority | Description forthcoming. |
SaveAllActionPriority | Description forthcoming. |
SearchActionPriority | Description forthcoming. |
ToolsCateogryPriority | Description forthcoming. |
UndoActionPriority | Description forthcoming. |
WindowCategoryPriority | Description forthcoming. |
Method Types
Accessing action parameters actionName actionPriority actionTitle categoryPriority descriptionPath descriptionPathComponents icon menuAccelerator setActionName setActionPriority setCategoryPriority setDescriptionPath setIcon setMenuAccelerator setShortDescription setSmallIcon shortDescription smallIcon Creating actions EOAction actionForControllerHierarchy actionForFocusComponent actionForObject standardActionForFocusComponent standardDocumentActionForControllerHierarchy standardDocumentActionForApplication standardDocumentActionForControllerHierarchy standardEditActionForControllerHierarchy Creating menu accelerators keyStrokeWithKeyCode keyStrokeWithKeyCodeAndModifiers keyStrokeWithKeyCodeAndShiftModifier keyStrokeWithString Accessing specific shared actions standardActivatePreviousWindowActionForApplication standardAddActionForControllerHierarchy standardAppendActionForControllerHierarchy standardCancelActionForControllerHierarchy standardClearActionForControllerHierarchy standardCloseWindowActionForControllerHierarchy standardDeleteActionForControllerHierarchy standardDeselectActionForControllerHierarchy standardEditActionsForFocusComponent standardFindActionForControllerHierarchy standardInsertActionForControllerHierarchy standardInsertWithTaskActionForControllerHierarchy standardOkActionForControllerHierarchy standardOkAndSaveActionForControllerHierarchy standardOpenWithTaskActionForControllerHierarchy standardQuitActionForApplication standardRedoActionForControllerHierarchy standardRefreshActionForApplication standardRemoveActionForControllerHierarchy standardRevertActionForControllerHierarchy standardSaveActionForControllerHierarchy standardSaveAllActionForApplication standardSelectActionForControllerHierarchy standardUndoActionForControllerHierarchy Managing actions actionCanBePerformedInContextOfController actionPerformed mergedActions sortedActions Managing the property change listener addPropertyChangeListener firePropertyChange removePropertyChangeListener Methods inherited from Object equals toString
Constructors
EOAction
public EOAction( String actionName, String descriptionPath, String shortDescription, javax.swing.Icon icon, javax.swing.Icon smallIcon, javax.swing.KeyStroke menuAccelerator, int categoryPriority, int actionPriority)
See Also: actionName, descriptionPath, shortDescription, icon, smallIcon, menuAccelerator, categoryPriority, and actionPriority.
Static Methods
actionForControllerHierarchy
public static EOAction actionForControllerHierarchy( String actionName, String descriptionPath, String shortDescription, javax.swing.Icon icon, javax.swing.Icon smallIcon, javax.swing.KeyStroke menuAccelerator, int categoryPriority, int actionPriority, boolean sendsActionToAllControllers)
true
, the action is dispatched to the subcontrollers of the controller that displays the action. Otherwise, the action is dispatched to the first subcontroller that responds to it.
See Also: EOAction, actionName, descriptionPath, shortDescription, icon, smallIcon, menuAccelerator, categoryPriority, and actionPriority.
actionForFocusComponent
public static EOAction actionForFocusComponent( String actionName, String descriptionPath, String shortDescription, javax.swing.Icon icon, javax.swing.Icon smallIcon, javax.swing.KeyStroke menuAccelerator, int categoryPriority, int actionPriority)
See Also: EOAction, actionName, descriptionPath, shortDescription, icon, smallIcon, menuAccelerator, categoryPriority, and actionPriority.
actionForObject
public static EOAction actionForObject( String actionName, String descriptionPath, String shortDescription, javax.swing.Icon icon, javax.swing.Icon smallIcon, javax.swing.KeyStroke menuAccelerator, int categoryPriority, int actionPriority, Object object)
See Also: EOAction, actionName, descriptionPath, shortDescription, icon, smallIcon, menuAccelerator, categoryPriority, and actionPriority.
keyStrokeWithKeyCode
public static javax.swing.KeyStroke keyStrokeWithKeyCode(int keyCode)
CTRL_MASK
). See Sun's javax.swing.KeyStroke documentation for more information.
keyStrokeWithKeyCodeAndModifiers
public static javax.swing.KeyStroke keyStrokeWithKeyCodeAndModifiers( int keyCode, int modifiers)
CTRL_MASK
). See Sun's javax.swing.KeyStroke documentation for more information.
keyStrokeWithKeyCodeAndShiftModifier
public static javax.swing.KeyStroke keyStrokeWithKeyCodeAndShiftModifier(int keyCode)
CTRL_MASK
). See Sun's javax.swing.KeyStroke documentation for more information.
keyStrokeWithString
public static javax.swing.KeyStroke keyStrokeWithString(String keyStrokeDescription)
CTRL_MASK
). See Sun's javax.swing.KeyStroke documentation for more information.
mergedActions
public static NSArray mergedActions( NSArray actionArray1, NSArray actionArray2)
sortedActions
public static NSArray sortedActions(NSArray actionArray)
See Also: categoryPriority, actionPriority, and descriptionPath.
standardActionForFocusComponent
public static EOAction standardActionForFocusComponent( String actionName, javax.swing.KeyStroke menuAccelerator, int actionPriority)
See Also: actionName, menuAccelerator, and actionPriority.
standardActivatePreviousWindowActionForApplication
public static EOAction standardActivatePreviousWindowActionForApplication()
standardAddActionForControllerHierarchy
public static EOAction standardAddActionForControllerHierarchy()
standardAppendActionForControllerHierarchy
public static EOAction standardAppendActionForControllerHierarchy()
standardCancelActionForControllerHierarchy
public static EOAction standardCancelActionForControllerHierarchy()
standardClearActionForControllerHierarchy
public static EOAction standardClearActionForControllerHierarchy()
standardCloseWindowActionForControllerHierarchy
public static EOAction standardCloseWindowActionForControllerHierarchy()
standardDeleteActionForControllerHierarchy
public static EOAction standardDeleteActionForControllerHierarchy()
standardDeselectActionForControllerHierarchy
public static EOAction standardDeselectActionForControllerHierarchy()
standardDocumentActionForApplication
public static EOAction standardDocumentActionForApplication( String actionName, javax.swing.KeyStroke menuAccelerator, int actionPriority)
standardDocumentActionForControllerHierarchy
public static EOAction standardDocumentActionForControllerHierarchy( String actionName, javax.swing.KeyStroke menuAccelerator, int actionPriority)
standardDocumentActionForControllerHierarchy
public static EOAction standardDocumentActionForControllerHierarchy( String actionName, String baseTitle, javax.swing.KeyStroke menuAccelerator, int actionPriority)
See Also: actionName, actionTitle, shortDescription, menuAccelerator, and actionPriority.
standardEditActionForControllerHierarchy
public static EOAction standardEditActionForControllerHierarchy( String actionName, javax.swing.KeyStroke menuAccelerator, int actionPriority)
See Also: actionName, menuAccelerator, and actionPriority.
standardEditActionsForFocusComponent
public static NSArray standardEditActionsForFocusComponent()
standardFindActionForControllerHierarchy
public static EOAction standardFindActionForControllerHierarchy()
standardInsertActionForControllerHierarchy
public static EOAction standardInsertActionForControllerHierarchy()
standardInsertWithTaskActionForControllerHierarchy
public static EOAction standardInsertWithTaskActionForControllerHierarchy()
standardOkActionForControllerHierarchy
public static EOAction standardOkActionForControllerHierarchy()
standardOkAndSaveActionForControllerHierarchy
public static EOAction standardOkAndSaveActionForControllerHierarchy()
standardOpenWithTaskActionForControllerHierarchy
public static EOAction standardOpenWithTaskActionForControllerHierarchy()
standardQuitActionForApplication
public static EOAction standardQuitActionForApplication()
standardRedoActionForControllerHierarchy
public static EOAction standardRedoActionForControllerHierarchy()
standardRefreshActionForApplication
public static EOAction standardRefreshActionForApplication()
standardRemoveActionForControllerHierarchy
public static EOAction standardRemoveActionForControllerHierarchy()
standardRevertActionForControllerHierarchy
public static EOAction standardRevertActionForControllerHierarchy()
standardSaveActionForControllerHierarchy
public static EOAction standardSaveActionForControllerHierarchy()
standardSaveAllActionForApplication
public static EOAction standardSaveAllActionForApplication()
standardSelectActionForControllerHierarchy
public static EOAction standardSelectActionForControllerHierarchy()
standardUndoActionForControllerHierarchy
public static EOAction standardUndoActionForControllerHierarchy()
Instance Methods
actionCanBePerformedInContextOfController
public boolean actionCanBePerformedInContextOfController(EOController controller)
actionName
public String actionName()
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent actionEvent)
actionPriority
public int actionPriority()
See Also: categoryPriority
actionTitle
public String actionTitle()
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
categoryPriority
public int categoryPriority()
descriptionPath
public String descriptionPath()
Document/Quit
.
descriptionPathComponents
public NSArray descriptionPathComponents()
equals
public boolean equals(Object anObject)
firePropertyChange
protected void firePropertyChange( String propertyName, Object oldValue, Object newValue)
icon
public javax.swing.Icon icon()
menuAccelerator
public javax.swing.KeyStroke menuAccelerator()
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
setActionName
public void setActionName(String actionName)
setActionPriority
public void setActionPriority(int actionPriority)
setCategoryPriority
public void setCategoryPriority(int categoryPriority)
setDescriptionPath
public void setDescriptionPath(String descriptionPath)
setIcon
public void setIcon(javax.swing.Icon icon)
setMenuAccelerator
public void setMenuAccelerator(javax.swing.KeyStroke menuAccelerator)
See Also: keyStrokeWithKeyCode, keyStrokeWithKeyCodeAndModifiers, keyStrokeWithKeyCodeAndShiftModifier, and keyStrokeWithString.
setShortDescription
public void setShortDescription(String shortDescription)
null
, the receiver's title is displayed instead.
See Also: actionTitle
setSmallIcon
public void setSmallIcon(javax.swing.Icon anIcon)
shortDescription
public String shortDescription()
null
or has not been assigned, shortDescription returns the action's title.
See Also: actionTitle
smallIcon
public javax.swing.Icon smallIcon()
See Also: shortDescription
toString
public String toString()
© 2001 Apple Computer, Inc. (Last Published April 14, 2001)