WebObjects 5.2.3

com.webobjects.eoapplication
Class EOAction

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended bycom.webobjects.eoapplication.EOAction
All Implemented Interfaces:
Action, ActionListener, Cloneable, EventListener, Serializable
Direct Known Subclasses:
EOEnterAction

public abstract class EOAction
extends AbstractAction

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 that displays the action. Methods whose controller 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 to access shared actions used in Direct to Java Client applications.

See Also:
Serialized Form

Nested Class Summary
static interface EOAction.ActiveWindowDependentAction
          If an EOAction object implements the EOAction.ActiveWindowDependentAction interface, it is given the opportunity to update its settings (like the menu accelerator) when the user switches the active window.
static interface EOAction.Enabling
          The EOAction.Enabling interface defines a method, canPerformActionNamed, which allows an action receiver to specify if an action (sent by an EOAction object) is enabled for the receiver.
 
Field Summary
static int ActivatePreviousWindowActionPriority
          The priority of the Activate Previous Window action.
static int AppendActionPriority
          The priority of the Append action.
static int BringAllWindowsToFrontActionPriority
          The priority of the Bring All To Front action.
static int CancelActionPriority
          The priority of the Cancel action.
static int ClearActionPriority
          The priority of the Clear action.
static int CloseWindowActionPriority
          The priority of the Close window action.
static int DeleteActionPriority
          The priority of the Delete action.
static String DescriptionPathSeparator
          The String used to separate the components of a description path.
static int DocumentCategoryPriority
          The priority of the Document category.
static int EditCategoryPriority
          The priority of the Edit category.
static int FindActionPriority
          The priority of the Find action.
static int HelpActionPriority
          The priority of the Help action.
static int HelpCategoryPriority
          The priority of the Help category.
static int InfoActionPriority
          The priority of the Info action.
static int InsertActionPriority
          The priority of the Insert action.
static int ListActionPriority
          The priority of the List action.
static int MinimizeActiveWindowActionPriority
          The priority of the Minimize Window action.
static int ModalActionsCategoryPriority
          The priority of the Modal actions category.
static int NavigationActionPriority
          The priority of the actions to navigate around in the user interface
static int NavigationActionsCategoryPriority
          The priority of the Navigation actions category.
static int NewMultipleWindowActionPriority
          The priority of actions that create multiple windows.
static int NewSingleWindowActionPriority
          The priority of actions that create single windows.
static int ObjectActionPriority
          The priority of the actions sent to business objects.
static int ObjectActionsCategoryPriority
          The priority of the Object actions category.
static int OkayActionPriority
          The priority of the Okay action.
static int OpenActionPriority
          The priority of the Open action.
static int PasteboardCopyActionPriority
          The priority of the pasteboard Copy action.
static int PasteboardCutActionPriority
          The priority of the pasteboard Cut action.
static int PasteboardDeleteActionPriority
          The priority of the pasteboard Delete action.
static int PasteboardPasteActionPriority
          The priority of the pasteboard Paste action.
static int PasteboardSelectAllActionPriority
          The priority of the pasteboard Select All action.
static int QuitActionPriority
          The priority of the Quit action.
static int RedoActionPriority
          The priority of the Redo action.
static int RefreshActionPriority
          The priority of the Refresh action.
static int RevertActionPriority
          The priority of the Revert action.
static int SaveActionPriority
          The priority of the Save action.
static int SaveAllActionPriority
          The priority of the Save All action.
static int SaveAsActionPriority
          The priority of the Save As action.
static int SearchActionPriority
          The priority of the Search action.
static int ToolsCategoryPriority
          The priority of the Tools category.
static int UndoActionPriority
          The priority of the Undo action.
static int WindowCategoryPriority
          The priority of the Windows category.
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
EOAction(String actionName, String descriptionPath, String shortDescription, Icon icon, Icon smallIcon, KeyStroke menuAccelerator, int categoryPriority, int actionPriority)
          Constructs a new EOAction as specified by the arguments.
 
Method Summary
 boolean actionCanBePerformedInContextOfController(EOController controller)
          Returns whether or not an action can trigger, which depends on the state of controllers in the controller hierarchy.
static EOAction actionForControllerHierarchy(String actionName, String descriptionPath, String shortDescription, Icon icon, Icon smallIcon, KeyStroke menuAccelerator, int categoryPriority, int actionPriority, boolean sendsActionToAllControllers)
          Returns a new action (an EOAction object) as specified by the arguments.
static EOAction actionForFocusComponent(String actionName, String descriptionPath, String shortDescription, Icon icon, Icon smallIcon, KeyStroke menuAccelerator, int categoryPriority, int actionPriority, String enabledKeyOnFocusComponent)
          Returns a new action (an EOAction object) as specified by the arguments.
static EOAction actionForObject(String actionName, String descriptionPath, String shortDescription, Icon icon, Icon smallIcon, KeyStroke menuAccelerator, int categoryPriority, int actionPriority, Object object)
          Returns a new action (an EOAction object) as specified by the arguments.
static EOAction actionForSupercontrollers(String actionName, String descriptionPath, String shortDescription, Icon icon, Icon smallIcon, KeyStroke menuAccelerator, int categoryPriority, int actionPriority, boolean sendsActionToAllControllers)
          Returns a new action (an EOAction object) as specified by the arguments.
 String actionName()
          Returns the name of the method that executes when the receiver triggers.
 void actionPerformed(ActionEvent event)
          This method is called when an action is triggered, that is, the user presses the action's button or selects its menu item.
 int actionPriority()
          Returns the receiver's action priority, which determines the order in which its button or menu item appears within a category.
 String actionTitle()
          Returns the receiver's title, the last component of the receiver's description path.
 void addPropertyChangeListener(PropertyChangeListener listener)
          See the method description for addPropertyChangeListener in Sun's documentation for javax.swing.AbstractAction.
 int categoryPriority()
          Returns the receiver's category priority, which determines the order in which the group of buttons or menu items that contains the receiver appears.
 String descriptionPath()
          Returns the receiver's menu hierarchy path, for example Document/Quit.
 NSArray descriptionPathComponents()
          Returns an NSArray containing the separate components of the receiver's menu hierarchy path.
 boolean equals(Object comparisionObject)
          Indicates whether some object "is equal to" this one.
protected  void firePropertyChange(String propertyName, Object oldValue, Object newValue)
          See the method description for firePropertyChange in Sun's documentation for javax.swing.AbstractAction.
 Icon icon()
          Returns the receiver's icon.
static KeyStroke keyStrokeWithKeyCode(int keyCode)
          Returns a KeyStroke given the numerical key code keyCode with the appropriate modifier for the client operating system (usually CTRL_MASK).
static KeyStroke keyStrokeWithKeyCodeAndModifiers(int keyCode, int modifiers)
          Returns a KeyStroke given the numerical key code keyCode and the modifier mask modifiers.
static KeyStroke keyStrokeWithKeyCodeAndShiftModifier(int keyCode)
          Returns a KeyStroke given the numerical key code keyCode with the SHIFT modifier.
static KeyStroke keyStrokeWithString(String keyStrokeDescription)
          Returns a KeyStroke for the String keyStrokeDescription.
 KeyStroke menuAccelerator()
          Returns the KeyStroke the user can type to invoke the receiver instead of selecting it from the menu.
static NSArray mergedActions(NSArray actions1, NSArray actions2)
          Returns an NSArray containing all of the actions in actionArray1 and actionArray2 with duplicate actions removed.
 void removePropertyChangeListener(PropertyChangeListener listener)
          See the method description for removePropertyChangeListener in Sun's documentation for javax.swing.AbstractAction.
 void setActionName(String actionName)
          Sets the name of the method that executes when the receiver triggers.
 void setActionPriority(int priority)
          Sets the receiver's action priority, which determines the order in which its button or menu item appears within a category.
 void setCategoryPriority(int priority)
          Sets the receiver's category priority, which determines the order in which the group of buttons or menu items that contains the receiver appears.
 void setDescriptionPath(String descriptionPath)
          Sets the receiver's menu hierarchy path to descriptionPath, for example Document/Quit.
 void setIcon(Icon icon)
          Sets the receiver's icon to icon.
 void setMenuAccelerator(KeyStroke menuAccelerator)
          Sets the KeyStroke the user can type to invoke the receiver instead of selecting it from a menu.
 void setShortDescription(String string)
          Sets the action's short description to string.
 void setSmallIcon(Icon icon)
          Sets the receiver's small icon used for some small buttons in the user interface.
 void setToolTip(String toolTip)
           
 String shortDescription()
          Returns the receiver's short description, which is displayed in buttons and pop-up menu items.
 Icon smallIcon()
          Returns the receiver's small icon used for some small buttons in the user interface.
static NSArray sortedActions(NSArray actions)
          Returns a sorted NSArray containing the specified actions.
static EOAction standardActionForFocusComponent(String actionName, KeyStroke menuAccelerator, int actionPriority, String enabledKeyOnFocusComponent)
          Returns a shared action as specified by the arguments.
static EOAction standardActivatePreviousWindowActionForWindowObserver()
          Returns a shared action (an EOAction object) for the activatePreviousWindow method, which is dispatched directly to the window observer object of the application.
static EOAction standardAddActionForControllerHierarchy()
          Returns a shared action (an EOAction object) for the add method which is dispatched in the controller hierarchy.
static EOAction standardAppendActionForControllerHierarchy()
          Returns a shared action (an EOAction object) for the append method which is dispatched in the controller hierarchy.
static EOAction standardBringAllWindowsToFrontActionForWindowObserver()
          Returns a shared action (an EOAction object) for the bringAllWindowsToFront method, which is dispatched directly to the window observer object of the application.
static EOAction standardCancelActionForControllerHierarchy()
          Returns a shared action (an EOAction object) for the cancel method which is dispatched in the controller hierarchy.
static EOAction standardClearActionForControllerHierarchy()
          Returns a shared action (an EOAction object) for the clear method which is dispatched in the controller hierarchy.
static EOAction standardCloseWindowActionForControllerHierarchy()
          Returns a shared action (an EOAction object) for the closeWindow method which is dispatched in the controller hierarchy.
static EOAction standardDeleteActionForControllerHierarchy()
          Returns a shared action (an EOAction object) for the delete method which is dispatched in the controller hierarchy.
static EOAction standardDeselectActionForControllerHierarchy()
          Returns a shared action (an EOAction object) for the deselect method which is dispatched in the controller hierarchy.
static EOAction standardDocumentActionForApplication(String actionName, KeyStroke menuAccelerator, int actionPriority)
          Returns an action with the method name actionName, menu accelerator menuAccelerator, and action priority actionPriority.
static EOAction standardDocumentActionForControllerHierarchy(String actionName, KeyStroke menuAccelerator, int actionPriority)
          Returns an action as specified by the arguments.
static EOAction standardDocumentActionForControllerHierarchy(String actionName, String baseTitle, KeyStroke menuAccelerator, int actionPriority)
          Returns an action as specified by the arguments.
static EOAction standardEditActionForControllerHierarchy(String actionName, KeyStroke menuAccelerator, int actionPriority)
          Returns an action as specified by the arguments.
static NSArray standardEditActionsForFocusComponent()
          Returns an NSArray containing shared actions for the cut, copy, paste and selectAll actions.
static EOAction standardFindActionForControllerHierarchy()
          Returns a shared action (an EOAction object) for the find method which is dispatched in the controller hierarchy.
static EOAction standardInsertActionForControllerHierarchy()
          Returns a shared action (an EOAction object) for the insert method which is dispatched in the controller hierarchy.
static EOAction standardInsertWithTaskActionForControllerHierarchy()
          Returns a shared action (an EOAction object) for the insertWithTask method which is dispatched in the controller hierarchy.
static EOAction standardMinimizeActiveWindowActionForWindowObserver()
          Returns a shared action (an EOAction object) for the minimizeActiveWindow method, which is dispatched directly to the window observer object of the application.
static EOAction standardOkActionForControllerHierarchy()
          Returns a shared action (an EOAction object) for the ok method which is dispatched in the controller hierarchy.
static EOAction standardOkAndSaveActionForControllerHierarchy()
          Returns a shared action (an EOAction object) for the ok method, displayed as a Save action, which is dispatched in the controller hierarchy.
static EOAction standardOpenWithTaskActionForControllerHierarchy()
          Returns a shared action (an EOAction object) for the openWithTask method which is dispatched in the controller hierarchy.
static EOAction standardQuitActionForApplication()
          Returns a shared action (an EOAction object) for the quit method, which is dispatched directly to the EOApplication object at the top of the controller hierarchy.
static EOAction standardRedoActionForControllerHierarchy()
          Returns a shared action (an EOAction object) for the redo method which is dispatched in the controller hierarchy.
static EOAction standardRefreshActionForApplication()
          Returns a shared action (an EOAction object) for the collectChangesFromServer method, displayed as a Refresh action, which is dispatched directly to the EOApplication object at the top of the controller hierarchy.
static EOAction standardRemoveActionForControllerHierarchy()
          Returns a shared action (an EOAction object) for the remove method which is dispatched in the controller hierarchy.
static EOAction standardRevertActionForControllerHierarchy()
          Returns a shared action (an EOAction object) for the revert method which is dispatched in the controller hierarchy.
static EOAction standardSaveActionForControllerHierarchy()
          Returns a shared action (an EOAction object) for the save method which is dispatched in the controller hierarchy.
static EOAction standardSaveAllActionForApplication()
          Returns a shared action (an EOAction object) for the saveAll method, which is dispatched directly to the EOApplication object at the top of the controller hierarchy.
static EOAction standardSaveAsActionForControllerHierarchy()
          Returns a shared action (an EOAction object) for the saveAs method which is dispatched in the controller hierarchy.
static EOAction standardSelectActionForControllerHierarchy()
          Returns a shared action (an EOAction object) for the select method which is dispatched in the controller hierarchy.
static EOAction standardUndoActionForControllerHierarchy()
          Returns a shared action (an EOAction object) for the undo method which is dispatched in the controller hierarchy.
 String toolTip()
           
 String toString()
          Returns the receiver as a string that states the receiver's method name, description path, category priority, and action priority.
 
Methods inherited from class javax.swing.AbstractAction
clone, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, setEnabled
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ActivatePreviousWindowActionPriority

public static final int ActivatePreviousWindowActionPriority
The priority of the Activate Previous Window action.

See Also:
standardActivatePreviousWindowActionForWindowObserver(), Constant Field Values

AppendActionPriority

public static final int AppendActionPriority
The priority of the Append action.

See Also:
standardAppendActionForControllerHierarchy(), Constant Field Values

BringAllWindowsToFrontActionPriority

public static final int BringAllWindowsToFrontActionPriority
The priority of the Bring All To Front action.

See Also:
standardBringAllWindowsToFrontActionForWindowObserver(), Constant Field Values

CancelActionPriority

public static final int CancelActionPriority
The priority of the Cancel action.

See Also:
standardCancelActionForControllerHierarchy(), Constant Field Values

ClearActionPriority

public static final int ClearActionPriority
The priority of the Clear action.

See Also:
standardClearActionForControllerHierarchy(), Constant Field Values

CloseWindowActionPriority

public static final int CloseWindowActionPriority
The priority of the Close window action.

See Also:
standardCloseWindowActionForControllerHierarchy(), Constant Field Values

DeleteActionPriority

public static final int DeleteActionPriority
The priority of the Delete action.

See Also:
standardDeleteActionForControllerHierarchy(), standardRemoveActionForControllerHierarchy(), standardDeselectActionForControllerHierarchy(), Constant Field Values

DescriptionPathSeparator

public static final String DescriptionPathSeparator
The String used to separate the components of a description path.


DocumentCategoryPriority

public static final int DocumentCategoryPriority
The priority of the Document category.

See Also:
standardDocumentActionForControllerHierarchy(String, KeyStroke, int), Constant Field Values

EditCategoryPriority

public static final int EditCategoryPriority
The priority of the Edit category.

See Also:
standardEditActionForControllerHierarchy(String, KeyStroke, int), standardActionForFocusComponent(String, KeyStroke, int, String), Constant Field Values

FindActionPriority

public static final int FindActionPriority
The priority of the Find action.

See Also:
standardFindActionForControllerHierarchy(), Constant Field Values

HelpActionPriority

public static final int HelpActionPriority
The priority of the Help action.

See Also:
Constant Field Values

HelpCategoryPriority

public static final int HelpCategoryPriority
The priority of the Help category.

See Also:
Constant Field Values

InfoActionPriority

public static final int InfoActionPriority
The priority of the Info action.

See Also:
Constant Field Values

InsertActionPriority

public static final int InsertActionPriority
The priority of the Insert action.

See Also:
standardInsertActionForControllerHierarchy(), standardInsertWithTaskActionForControllerHierarchy(), standardAddActionForControllerHierarchy(), standardSelectActionForControllerHierarchy(), Constant Field Values

ListActionPriority

public static final int ListActionPriority
The priority of the List action.

See Also:
standardOpenWithTaskActionForControllerHierarchy(), Constant Field Values

MinimizeActiveWindowActionPriority

public static final int MinimizeActiveWindowActionPriority
The priority of the Minimize Window action.

See Also:
standardMinimizeActiveWindowActionForWindowObserver(), Constant Field Values

ModalActionsCategoryPriority

public static final int ModalActionsCategoryPriority
The priority of the Modal actions category.

See Also:
standardCancelActionForControllerHierarchy(), standardOkActionForControllerHierarchy(), standardOkAndSaveActionForControllerHierarchy(), Constant Field Values

NavigationActionPriority

public static final int NavigationActionPriority
The priority of the actions to navigate around in the user interface

See Also:
EOWindowController.defaultActions(), Constant Field Values

NavigationActionsCategoryPriority

public static final int NavigationActionsCategoryPriority
The priority of the Navigation actions category.

See Also:
EOWindowController.defaultActions(), Constant Field Values

NewMultipleWindowActionPriority

public static final int NewMultipleWindowActionPriority
The priority of actions that create multiple windows.

See Also:
Constant Field Values

NewSingleWindowActionPriority

public static final int NewSingleWindowActionPriority
The priority of actions that create single windows.

See Also:
Constant Field Values

ObjectActionPriority

public static final int ObjectActionPriority
The priority of the actions sent to business objects.

See Also:
Constant Field Values

ObjectActionsCategoryPriority

public static final int ObjectActionsCategoryPriority
The priority of the Object actions category.

See Also:
Constant Field Values

OkayActionPriority

public static final int OkayActionPriority
The priority of the Okay action.

See Also:
standardOkActionForControllerHierarchy(), standardOkAndSaveActionForControllerHierarchy(), Constant Field Values

OpenActionPriority

public static final int OpenActionPriority
The priority of the Open action.

See Also:
standardOpenWithTaskActionForControllerHierarchy(), Constant Field Values

PasteboardCopyActionPriority

public static final int PasteboardCopyActionPriority
The priority of the pasteboard Copy action.

See Also:
standardEditActionsForFocusComponent(), Constant Field Values

PasteboardCutActionPriority

public static final int PasteboardCutActionPriority
The priority of the pasteboard Cut action.

See Also:
standardEditActionsForFocusComponent(), Constant Field Values

PasteboardDeleteActionPriority

public static final int PasteboardDeleteActionPriority
The priority of the pasteboard Delete action.

See Also:
standardEditActionsForFocusComponent(), Constant Field Values

PasteboardPasteActionPriority

public static final int PasteboardPasteActionPriority
The priority of the pasteboard Paste action.

See Also:
standardEditActionsForFocusComponent(), Constant Field Values

PasteboardSelectAllActionPriority

public static final int PasteboardSelectAllActionPriority
The priority of the pasteboard Select All action.

See Also:
standardEditActionsForFocusComponent(), Constant Field Values

QuitActionPriority

public static final int QuitActionPriority
The priority of the Quit action.

See Also:
standardQuitActionForApplication(), Constant Field Values

RedoActionPriority

public static final int RedoActionPriority
The priority of the Redo action.

See Also:
standardRedoActionForControllerHierarchy(), Constant Field Values

RefreshActionPriority

public static final int RefreshActionPriority
The priority of the Refresh action.

See Also:
standardRefreshActionForApplication(), Constant Field Values

RevertActionPriority

public static final int RevertActionPriority
The priority of the Revert action.

See Also:
standardRevertActionForControllerHierarchy(), Constant Field Values

SaveActionPriority

public static final int SaveActionPriority
The priority of the Save action.

See Also:
standardSaveActionForControllerHierarchy(), Constant Field Values

SaveAllActionPriority

public static final int SaveAllActionPriority
The priority of the Save All action.

See Also:
standardSaveAllActionForApplication(), Constant Field Values

SaveAsActionPriority

public static final int SaveAsActionPriority
The priority of the Save As action.

See Also:
standardSaveAsActionForControllerHierarchy(), Constant Field Values

SearchActionPriority

public static final int SearchActionPriority
The priority of the Search action.

See Also:
Constant Field Values

ToolsCategoryPriority

public static final int ToolsCategoryPriority
The priority of the Tools category.

See Also:
Constant Field Values

UndoActionPriority

public static final int UndoActionPriority
The priority of the Undo action.

See Also:
standardUndoActionForControllerHierarchy(), Constant Field Values

WindowCategoryPriority

public static final int WindowCategoryPriority
The priority of the Windows category.

See Also:
standardCloseWindowActionForControllerHierarchy(), Constant Field Values
Constructor Detail

EOAction

public EOAction(String actionName,
                String descriptionPath,
                String shortDescription,
                Icon icon,
                Icon smallIcon,
                KeyStroke menuAccelerator,
                int categoryPriority,
                int actionPriority)
Constructs a new EOAction as specified by the arguments.

Parameters:
actionName - the name of the action method
descriptionPath - the description path of the action
shortDescription - the short description of the action
icon - the icon of the action
smallIcon - the small icon of the action
menuAccelerator - the menu accelerator of the action
categoryPriority - the category priority of the action
actionPriority - the action priority of the action
See Also:
actionName(), descriptionPath(), shortDescription(), icon(), smallIcon(), menuAccelerator(), categoryPriority(), actionPriority()
Method Detail

actionCanBePerformedInContextOfController

public boolean actionCanBePerformedInContextOfController(EOController controller)
Returns whether or not an action can trigger, which depends on the state of controllers in the controller hierarchy. For example, a Save action for an unedited document can usually not trigger.

Parameters:
controller - the EOController
Returns:
true if an action can trigger; false otherwise

actionForControllerHierarchy

public static EOAction actionForControllerHierarchy(String actionName,
                                                    String descriptionPath,
                                                    String shortDescription,
                                                    Icon icon,
                                                    Icon smallIcon,
                                                    KeyStroke menuAccelerator,
                                                    int categoryPriority,
                                                    int actionPriority,
                                                    boolean sendsActionToAllControllers)
Returns a new action (an EOAction object) as specified by the arguments. When this action triggers, it is dispatched to the subcontrollers of the controller that displays it. If sendsActionToAllControllers is true, the action is dispatched to all subcontrollers of the controller that displays the action. Otherwise, the action is dispatched only to the first subcontroller that responds to it.

Parameters:
actionName - the name of the action method
descriptionPath - the description path of the action
shortDescription - the short description of the action
icon - the icon of the action
smallIcon - the small icon of the action
menuAccelerator - the menu accelerator of the action
categoryPriority - the category priority of the action
actionPriority - the action priority of the action
sendsActionToAllControllers - whether to dispatch the action to all subcontrollers or just to the first that responds
Returns:
a new action as specified by the arguments
See Also:
actionName(), descriptionPath(), shortDescription(), icon(), smallIcon(), menuAccelerator(), categoryPriority(), actionPriority()

actionForFocusComponent

public static EOAction actionForFocusComponent(String actionName,
                                               String descriptionPath,
                                               String shortDescription,
                                               Icon icon,
                                               Icon smallIcon,
                                               KeyStroke menuAccelerator,
                                               int categoryPriority,
                                               int actionPriority,
                                               String enabledKeyOnFocusComponent)
Returns a new action (an EOAction object) as specified by the arguments. When this action triggers, it is dispatched to the active widget (for example, the text field containing the cursor). The enabledKeyOnFocusComponent specifies the name of the field or method, resolved by key-value coding, specifying whether the action is enabled for the focus component (for example, "editable" for the action "cut").

Parameters:
actionName - the name of the action method
descriptionPath - the description path of the action
shortDescription - the short description of the action
icon - the icon of the action
smallIcon - the small icon of the action
menuAccelerator - the menu accelerator of the action
categoryPriority - the category priority of the action
actionPriority - the action priority of the action
enabledKeyOnFocusComponent - the key path to resolve to determine whether the action is enabled for the focus component
See Also:
actionName(), descriptionPath(), shortDescription(), icon(), smallIcon(), menuAccelerator(), categoryPriority(), actionPriority()

actionForObject

public static EOAction actionForObject(String actionName,
                                       String descriptionPath,
                                       String shortDescription,
                                       Icon icon,
                                       Icon smallIcon,
                                       KeyStroke menuAccelerator,
                                       int categoryPriority,
                                       int actionPriority,
                                       Object object)
Returns a new action (an EOAction object) as specified by the arguments. When this action triggers, it is dispatched directly to the one object specified when invoking this method. To create an action that gets dispatched to the application object, set object to EOApplication.sharedApplication().

Parameters:
actionName - the name of the action method
descriptionPath - the description path of the action
shortDescription - the short description of the action
icon - the icon of the action
smallIcon - the small icon of the action
menuAccelerator - the menu accelerator of the action
categoryPriority - the category priority of the action
actionPriority - the action priority of the action
object - the object to which the action is dispatched
See Also:
descriptionPath(), shortDescription(), icon(), smallIcon(), menuAccelerator(), categoryPriority(), actionPriority()

actionForSupercontrollers

public static EOAction actionForSupercontrollers(String actionName,
                                                 String descriptionPath,
                                                 String shortDescription,
                                                 Icon icon,
                                                 Icon smallIcon,
                                                 KeyStroke menuAccelerator,
                                                 int categoryPriority,
                                                 int actionPriority,
                                                 boolean sendsActionToAllControllers)
Returns a new action (an EOAction object) as specified by the arguments. When this action triggers, it is dispatched to the supercontrollers of the controller that displays it. If sendsActionToAllControllers is true, the action is dispatched to all supercontrollers of the controller that displays the action. Otherwise, the action is dispatched only to the first supercontroller that responds to it.

Parameters:
actionName - the name of the action method
descriptionPath - the description path of the action
shortDescription - the short description of the action
icon - the icon of the action
smallIcon - the small icon of the action
menuAccelerator - the menu accelerator of the action
categoryPriority - the category priority of the action
actionPriority - the action priority of the action
sendsActionToAllControllers - whether to dispatch the action to all supercontrollers or just to the first that responds
Returns:
a new action as specified by the arguments
See Also:
actionName(), descriptionPath(), shortDescription(), icon(), smallIcon(), menuAccelerator(), categoryPriority(), actionPriority()

actionName

public String actionName()
Returns the name of the method that executes when the receiver triggers.

Returns:
the name of the method that executes when the receiver triggers

actionPerformed

public void actionPerformed(ActionEvent event)
This method is called when an action is triggered, that is, the user presses the action's button or selects its menu item. This method must be overridden by subclasses.

Parameters:
event - the ActionEvent

actionPriority

public int actionPriority()
Returns the receiver's action priority, which determines the order in which its button or menu item appears within a category.

Returns:
the receiver's action priority
See Also:
categoryPriority()

actionTitle

public String actionTitle()
Returns the receiver's title, the last component of the receiver's description path.

Returns:
the receiver's title

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
See the method description for addPropertyChangeListener in Sun's documentation for javax.swing.AbstractAction.

Parameters:
listener - the PropertyChangeListener
See Also:
AbstractAction.addPropertyChangeListener(PropertyChangeListener)

categoryPriority

public int categoryPriority()
Returns the receiver's category priority, which determines the order in which the group of buttons or menu items that contains the receiver appears.

Returns:
the receiver's category priority

descriptionPath

public String descriptionPath()
Returns the receiver's menu hierarchy path, for example Document/Quit.

Returns:
the receiver's menu hierarchy path

descriptionPathComponents

public NSArray descriptionPathComponents()
Returns an NSArray containing the separate components of the receiver's menu hierarchy path.

Returns:
an NSArray containing the separate components of the receiver's menu hierarchy path

equals

public boolean equals(Object comparisionObject)
Indicates whether some object "is equal to" this one.

Parameters:
comparisionObject - the reference object with which to compare
Returns:
true if this object is the same as the comparisionObject argument; false otherwise

firePropertyChange

protected void firePropertyChange(String propertyName,
                                  Object oldValue,
                                  Object newValue)
See the method description for firePropertyChange in Sun's documentation for javax.swing.AbstractAction.

See Also:
AbstractAction.firePropertyChange(String, Object, Object)

icon

public Icon icon()
Returns the receiver's icon.

Returns:
the receiver's icon

keyStrokeWithKeyCode

public static KeyStroke keyStrokeWithKeyCode(int keyCode)
Returns a KeyStroke given the numerical key code keyCode with the appropriate modifier for the client operating system (usually CTRL_MASK). See Sun's javax.swing.KeyStroke documentation for more information.

Parameters:
keyCode - the numerical key code
Returns:
the KeyStroke that matches the keyCode
See Also:
KeyStroke

keyStrokeWithKeyCodeAndModifiers

public static KeyStroke keyStrokeWithKeyCodeAndModifiers(int keyCode,
                                                         int modifiers)
Returns a KeyStroke given the numerical key code keyCode and the modifier mask modifiers. This method adds the appropriate modifier for the client operating system (usually CTRL_MASK). See Sun's javax.swing.KeyStroke documentation for more information.

Parameters:
keyCode - the numerical key code
modifiers - the modifier mask
Returns:
the KeyStroke that matches the keyCode and modifiers
See Also:
KeyStroke

keyStrokeWithKeyCodeAndShiftModifier

public static KeyStroke keyStrokeWithKeyCodeAndShiftModifier(int keyCode)
Returns a KeyStroke given the numerical key code keyCode with the SHIFT modifier. This method also adds the appropriate modifier for the client operating system (usually CTRL_MASK). See Sun's javax.swing.KeyStroke documentation for more information.

Parameters:
keyCode - the numerical key code
Returns:
the KeyStroke that matches the keyCode with the SHIFT modifier
See Also:
KeyStroke

keyStrokeWithString

public static KeyStroke keyStrokeWithString(String keyStrokeDescription)
Returns a KeyStroke for the String keyStrokeDescription. This method adds the appropriate modifier for the client operating system (usually CTRL_MASK). See Sun's javax.swing.KeyStroke documentation for more information.

Parameters:
keyStrokeDescription - the description of the KeyStroke
Returns:
the KeyStroke that matches the description if one exists; null otherwise
See Also:
KeyStroke

menuAccelerator

public KeyStroke menuAccelerator()
Returns the KeyStroke the user can type to invoke the receiver instead of selecting it from the menu.

Returns:
the KeyStroke to invoke the receiver

mergedActions

public static NSArray mergedActions(NSArray actions1,
                                    NSArray actions2)
Returns an NSArray containing all of the actions in actionArray1 and actionArray2 with duplicate actions removed.

Parameters:
actions1 - an NSArray of actions
actions2 - an NSArray of actions
Returns:
an NSArray of the union of actions1 and action2

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
See the method description for removePropertyChangeListener in Sun's documentation for javax.swing.AbstractAction.

Parameters:
listener - the PropertyChangeListener
See Also:
AbstractAction.removePropertyChangeListener(PropertyChangeListener)

setActionName

public void setActionName(String actionName)
Sets the name of the method that executes when the receiver triggers.

Parameters:
actionName - the name of the method that executes when the receiver triggers

setActionPriority

public void setActionPriority(int priority)
Sets the receiver's action priority, which determines the order in which its button or menu item appears within a category.

Parameters:
priority - the receiver's action priority

setCategoryPriority

public void setCategoryPriority(int priority)
Sets the receiver's category priority, which determines the order in which the group of buttons or menu items that contains the receiver appears.

Parameters:
priority - the receiver's category priority

setDescriptionPath

public void setDescriptionPath(String descriptionPath)
Sets the receiver's menu hierarchy path to descriptionPath, for example Document/Quit.

Parameters:
descriptionPath - the receiver's menu hierarchy path

setIcon

public void setIcon(Icon icon)
Sets the receiver's icon to icon.

Parameters:
icon - the icon

setMenuAccelerator

public void setMenuAccelerator(KeyStroke menuAccelerator)
Sets the KeyStroke the user can type to invoke the receiver instead of selecting it from a menu.

Parameters:
menuAccelerator - the KeyStroke to invoke the receiver
See Also:
keyStrokeWithKeyCode(int), keyStrokeWithKeyCodeAndModifiers(int, int), keyStrokeWithKeyCodeAndShiftModifier(int)

setShortDescription

public void setShortDescription(String string)
Sets the action's short description to string. The short description appears in buttons and pop-up menu items. If shortDescription is null, the receiver's title is displayed instead.

Parameters:
string - the action's short description
See Also:
actionTitle()

setSmallIcon

public void setSmallIcon(Icon icon)
Sets the receiver's small icon used for some small buttons in the user interface.

Parameters:
icon - the receiver's small icon

setToolTip

public void setToolTip(String toolTip)

shortDescription

public String shortDescription()
Returns the receiver's short description, which is displayed in buttons and pop-up menu items. If the short description is set to null or has not been assigned, shortDescription returns the action's title.

Returns:
the receiver's short description
See Also:
actionTitle()

smallIcon

public Icon smallIcon()
Returns the receiver's small icon used for some small buttons in the user interface. By default, the small icon is not displayed for such buttons; the short description is displayed instead.

Returns:
the receiver's small icon
See Also:
shortDescription()

sortedActions

public static NSArray sortedActions(NSArray actions)
Returns a sorted NSArray containing the specified actions. The actions are sorted first on the category priority, then on the action priority, and finally on the description path.

Parameters:
actions - an NSArray of actions
Returns:
a sorted NSArray of actions
See Also:
categoryPriority(), actionPriority(), descriptionPath()

standardActionForFocusComponent

public static EOAction standardActionForFocusComponent(String actionName,
                                                       KeyStroke menuAccelerator,
                                                       int actionPriority,
                                                       String enabledKeyOnFocusComponent)
Returns a shared action as specified by the arguments. When the action triggers, it is dispatched to the focus component (for example, the active text field) The action's category priority is EOAction.EditCategoryPriority, so the action is grouped with the other edit actions.

Parameters:
actionName - the name of the action
menuAccelerator - the menu accelerator of the action
actionPriority - the action priority of the action
enabledKeyOnFocusComponent - the key path to resolve to determine whether the action is enabled for the focus component
Returns:
a shared action as specified by the arguments
See Also:
actionName(), menuAccelerator(), actionPriority(), EditCategoryPriority

standardActivatePreviousWindowActionForWindowObserver

public static EOAction standardActivatePreviousWindowActionForWindowObserver()
Returns a shared action (an EOAction object) for the activatePreviousWindow method, which is dispatched directly to the window observer object of the application.

Returns:
a shared action for the activatePreviousWindow method
See Also:
ActivatePreviousWindowActionPriority

standardAddActionForControllerHierarchy

public static EOAction standardAddActionForControllerHierarchy()
Returns a shared action (an EOAction object) for the add method which is dispatched in the controller hierarchy.

Returns:
a shared action for the add method
See Also:
InsertActionPriority

standardAppendActionForControllerHierarchy

public static EOAction standardAppendActionForControllerHierarchy()
Returns a shared action (an EOAction object) for the append method which is dispatched in the controller hierarchy.

Returns:
a shared action for the append method
See Also:
AppendActionPriority

standardBringAllWindowsToFrontActionForWindowObserver

public static EOAction standardBringAllWindowsToFrontActionForWindowObserver()
Returns a shared action (an EOAction object) for the bringAllWindowsToFront method, which is dispatched directly to the window observer object of the application.

Returns:
a shared action for the bringAllWindowsToFront method
See Also:
BringAllWindowsToFrontActionPriority

standardCancelActionForControllerHierarchy

public static EOAction standardCancelActionForControllerHierarchy()
Returns a shared action (an EOAction object) for the cancel method which is dispatched in the controller hierarchy.

Returns:
a shared action for the cancel method
See Also:
CancelActionPriority

standardClearActionForControllerHierarchy

public static EOAction standardClearActionForControllerHierarchy()
Returns a shared action (an EOAction object) for the clear method which is dispatched in the controller hierarchy.

Returns:
a shared action for the clear method
See Also:
ClearActionPriority

standardCloseWindowActionForControllerHierarchy

public static EOAction standardCloseWindowActionForControllerHierarchy()
Returns a shared action (an EOAction object) for the closeWindow method which is dispatched in the controller hierarchy.

Returns:
a shared action for the closeWindow method
See Also:
CloseWindowActionPriority

standardDeleteActionForControllerHierarchy

public static EOAction standardDeleteActionForControllerHierarchy()
Returns a shared action (an EOAction object) for the delete method which is dispatched in the controller hierarchy.

Returns:
a shared action for the delete method
See Also:
DeleteActionPriority

standardDeselectActionForControllerHierarchy

public static EOAction standardDeselectActionForControllerHierarchy()
Returns a shared action (an EOAction object) for the deselect method which is dispatched in the controller hierarchy.

Returns:
a shared action for the deselect method
See Also:
DeleteActionPriority

standardDocumentActionForApplication

public static EOAction standardDocumentActionForApplication(String actionName,
                                                            KeyStroke menuAccelerator,
                                                            int actionPriority)
Returns an action with the method name actionName, menu accelerator menuAccelerator, and action priority actionPriority. When the action triggers, it is dispatched directly to the EOApplication object at the top of the controller hierarchy. The action's category priority is EOAction.DocumentCategoryPriority, so the action is grouped with the other document actions.

Parameters:
actionName - the name of the action
menuAccelerator - the menu accelerator of the action
actionPriority - the action priority of the action
Returns:
a shared action as specified by the arguments

standardDocumentActionForControllerHierarchy

public static EOAction standardDocumentActionForControllerHierarchy(String actionName,
                                                                    String baseTitle,
                                                                    KeyStroke menuAccelerator,
                                                                    int actionPriority)
Returns an action as specified by the arguments. The baseTitle parameter is the name of the action as it appears in the user interface and is used for both the short description and the action title. When the action triggers, it is dispatched to the subcontrollers of the controller that displays it. The action's category priority is EOAction.DocumentCategoryPriority, so the action is grouped with the other document actions.

Parameters:
actionName - the name of the action method
baseTitle - used for both the short description and action title
menuAccelerator - the menu accelerator of the action
actionPriority - the action priority of the action
Returns:
a shared action as specified by the arguments
See Also:
actionName(), actionTitle(), shortDescription(), menuAccelerator(), actionPriority(), DocumentCategoryPriority

standardDocumentActionForControllerHierarchy

public static EOAction standardDocumentActionForControllerHierarchy(String actionName,
                                                                    KeyStroke menuAccelerator,
                                                                    int actionPriority)
Returns an action as specified by the arguments. When the action triggers, it is dispatched to the subcontrollers of the controller that displays it. The action's category priority is EOAction.DocumentCategoryPriority, so the action is grouped with the other document actions.

Parameters:
actionName - the name of the action method
menuAccelerator - the menu accelerator of the action
actionPriority - the action priority of the action
Returns:
a shared action as specified by the arguments
See Also:
actionName(), actionTitle(), shortDescription(), menuAccelerator(), actionPriority(), DocumentCategoryPriority

standardEditActionForControllerHierarchy

public static EOAction standardEditActionForControllerHierarchy(String actionName,
                                                                KeyStroke menuAccelerator,
                                                                int actionPriority)
Returns an action as specified by the arguments. When the action triggers, it is dispatched to the subcontrollers of the controller that displays it. The action's category priority is EOAction.EditCategoryPriority, so the action is grouped with the other edit actions.

Parameters:
actionName - the name of the action
menuAccelerator - the menu accelerator of the action
actionPriority - the action priority of the action
Returns:
a shared action as specified by the arguments
See Also:
actionName(), menuAccelerator(), actionPriority()

standardEditActionsForFocusComponent

public static NSArray standardEditActionsForFocusComponent()
Returns an NSArray containing shared actions for the cut, copy, paste and selectAll actions. When these actions trigger, they are dispatched to the focus component.

Returns:
an NSArray containing shared actions for the cut, copy, paste and selectAll actions
See Also:
PasteboardCutActionPriority, PasteboardCopyActionPriority, PasteboardPasteActionPriority, PasteboardSelectAllActionPriority

standardFindActionForControllerHierarchy

public static EOAction standardFindActionForControllerHierarchy()
Returns a shared action (an EOAction object) for the find method which is dispatched in the controller hierarchy.

Returns:
a shared action for the find method
See Also:
FindActionPriority

standardInsertActionForControllerHierarchy

public static EOAction standardInsertActionForControllerHierarchy()
Returns a shared action (an EOAction object) for the insert method which is dispatched in the controller hierarchy.

Returns:
a shared action for the insert method
See Also:
InsertActionPriority

standardInsertWithTaskActionForControllerHierarchy

public static EOAction standardInsertWithTaskActionForControllerHierarchy()
Returns a shared action (an EOAction object) for the insertWithTask method which is dispatched in the controller hierarchy.

Returns:
a shared action for the insertWithTask method
See Also:
InsertActionPriority

standardMinimizeActiveWindowActionForWindowObserver

public static EOAction standardMinimizeActiveWindowActionForWindowObserver()
Returns a shared action (an EOAction object) for the minimizeActiveWindow method, which is dispatched directly to the window observer object of the application.

Returns:
a shared action for the minimizeActiveWindow method
See Also:
MinimizeActiveWindowActionPriority

standardOkActionForControllerHierarchy

public static EOAction standardOkActionForControllerHierarchy()
Returns a shared action (an EOAction object) for the ok method which is dispatched in the controller hierarchy.

Returns:
a shared action for the ok method
See Also:
OkayActionPriority

standardOkAndSaveActionForControllerHierarchy

public static EOAction standardOkAndSaveActionForControllerHierarchy()
Returns a shared action (an EOAction object) for the ok method, displayed as a Save action, which is dispatched in the controller hierarchy.

Returns:
a shared action for the ok method, displayed as a Save action
See Also:
OkayActionPriority

standardOpenWithTaskActionForControllerHierarchy

public static EOAction standardOpenWithTaskActionForControllerHierarchy()
Returns a shared action (an EOAction object) for the openWithTask method which is dispatched in the controller hierarchy.

Returns:
a shared action for the openWithTask method
See Also:
OpenActionPriority

standardQuitActionForApplication

public static EOAction standardQuitActionForApplication()
Returns a shared action (an EOAction object) for the quit method, which is dispatched directly to the EOApplication object at the top of the controller hierarchy.

Returns:
a shared action for the quit method
See Also:
QuitActionPriority

standardRedoActionForControllerHierarchy

public static EOAction standardRedoActionForControllerHierarchy()
Returns a shared action (an EOAction object) for the redo method which is dispatched in the controller hierarchy.

Returns:
a shared action for the redo method
See Also:
RedoActionPriority

standardRefreshActionForApplication

public static EOAction standardRefreshActionForApplication()
Returns a shared action (an EOAction object) for the collectChangesFromServer method, displayed as a Refresh action, which is dispatched directly to the EOApplication object at the top of the controller hierarchy.

Returns:
a shared action for the collectChangesFromServer method
See Also:
RefreshActionPriority

standardRemoveActionForControllerHierarchy

public static EOAction standardRemoveActionForControllerHierarchy()
Returns a shared action (an EOAction object) for the remove method which is dispatched in the controller hierarchy.

Returns:
a shared action for the remove method
See Also:
DeleteActionPriority

standardRevertActionForControllerHierarchy

public static EOAction standardRevertActionForControllerHierarchy()
Returns a shared action (an EOAction object) for the revert method which is dispatched in the controller hierarchy.

Returns:
a shared action for the revert method
See Also:
RevertActionPriority

standardSaveActionForControllerHierarchy

public static EOAction standardSaveActionForControllerHierarchy()
Returns a shared action (an EOAction object) for the save method which is dispatched in the controller hierarchy.

Returns:
a shared action for the save method
See Also:
SaveActionPriority

standardSaveAllActionForApplication

public static EOAction standardSaveAllActionForApplication()
Returns a shared action (an EOAction object) for the saveAll method, which is dispatched directly to the EOApplication object at the top of the controller hierarchy.

Returns:
a shared action for the saveAll method
See Also:
SaveAllActionPriority

standardSaveAsActionForControllerHierarchy

public static EOAction standardSaveAsActionForControllerHierarchy()
Returns a shared action (an EOAction object) for the saveAs method which is dispatched in the controller hierarchy.

Returns:
a shared action for the saveAs method
See Also:
SaveAsActionPriority

standardSelectActionForControllerHierarchy

public static EOAction standardSelectActionForControllerHierarchy()
Returns a shared action (an EOAction object) for the select method which is dispatched in the controller hierarchy.

Returns:
a shared action for the select method
See Also:
InsertActionPriority

standardUndoActionForControllerHierarchy

public static EOAction standardUndoActionForControllerHierarchy()
Returns a shared action (an EOAction object) for the undo method which is dispatched in the controller hierarchy.

Returns:
a shared action for the undo method
See Also:
UndoActionPriority

toString

public String toString()
Returns the receiver as a string that states the receiver's method name, description path, category priority, and action priority.

Returns:
the String representation of the receiver

toolTip

public String toolTip()

Last updated Thu Oct 21 15:04:16 PDT 2004.

Copyright © 2004 Apple Computer, Inc.