| java.lang.Object org.netbeans.modules.visualweb.gravy.actions.Action
All known Subclasses: org.netbeans.modules.visualweb.gravy.actions.BuildProjectAction, org.netbeans.modules.visualweb.gravy.actions.DeleteAction, org.netbeans.modules.visualweb.gravy.actions.ShowDescriptionAreaAction, org.netbeans.modules.visualweb.gravy.actions.CloseProjectAction, org.netbeans.modules.visualweb.gravy.actions.SaveAction, org.netbeans.modules.visualweb.gravy.actions.OptionsViewAction, org.netbeans.modules.visualweb.gravy.websvc.actions.CreateGroupAction, org.netbeans.modules.visualweb.gravy.actions.HelpAction, org.netbeans.modules.visualweb.gravy.websvc.actions.AddWebServiceAction, org.netbeans.modules.visualweb.gravy.actions.ShowProjectsAction, org.netbeans.modules.visualweb.gravy.actions.ActionNoBlock, org.netbeans.modules.visualweb.gravy.actions.SortByCategoryAction, org.netbeans.modules.visualweb.gravy.actions.SortByNameAction, org.netbeans.modules.visualweb.gravy.actions.ShowFilesAction, org.netbeans.modules.visualweb.gravy.actions.FindAction, org.netbeans.modules.visualweb.gravy.actions.PropertiesAction,
Action | public class Action (Code) | | Ancestor class for all blocking actions.
It handles performing action through main menu (MENU_MODE), popup menu
(POPUP_MODE), IDE SystemAction API call (API_MODE) or through keyboard shortcut
(SHORTCUT_MODE).
Action can be performed in exact mode by calling performMenu(...),
performPopup(...), performAPI(...) or performShortcut(...).
If exact mode is not supported by the action it throws
UnsupportedOperationException.
Current implementation supports MENU_MODE when menuPath is defined, POPUP_MODE
when popupPath is defined, API_MODE when systemActionClass is defined and
SHORTCUT_MODE when shorcut is defined (see Action constructors).
Action also can be performed using runtime default mode by calling perform(...).
When default mode is not support by the action other modes are tried till
supported mode found and action is performed.
Timeouts used:
Action.WaitAfterShortcutTimeout - time to sleep between shortcuts in sequence (default 0)
author: Adam Sotona |
Inner Class :public static class Shortcut extends Object | |
Constructor Summary | |
public | Action(String menuPath, String popupPath) | public | Action(String menuPath, String popupPath, String systemActionClass) | public | Action(String menuPath, String popupPath, Shortcut[] shortcuts) | public | Action(String menuPath, String popupPath, Shortcut shortcut) | public | Action(String menuPath, String popupPath, String systemActionClass, Shortcut[] shortcuts) | public | Action(String menuPath, String popupPath, String systemActionClass, Shortcut shortcut) |
AFTER_ACTION_WAIT_TIME | final protected static long AFTER_ACTION_WAIT_TIME(Code) | | sleep time after action execution
|
API_MODE | final public static int API_MODE(Code) | | through API action performing mode
|
MENU_MODE | final public static int MENU_MODE(Code) | | through menu action performing mode
|
POPUP_MODE | final public static int POPUP_MODE(Code) | | through popup menu action performing mode
|
SELECTION_WAIT_TIME | final protected static long SELECTION_WAIT_TIME(Code) | | sleep time between nodes selection and action execution
|
SHORTCUT_MODE | final public static int SHORTCUT_MODE(Code) | | through shortcut action performing mode
|
WAIT_AFTER_SHORTCUT_TIMEOUT | final protected static long WAIT_AFTER_SHORTCUT_TIMEOUT(Code) | | sleep time between sequence of shortcuts
|
menuPath | protected String menuPath(Code) | | menu path of current action or null when MENU_MODE is not supported
|
popupPath | protected String popupPath(Code) | | popup menu path of current action or null when POPUP_MODE is not supported
|
shortcuts | protected Shortcut[] shortcuts(Code) | | array of shortcuts of current action or null when SHORTCUT_MODE is not supported
|
systemActionClass | protected Class systemActionClass(Code) | | SystemAction class of current action or null when API_MODE is not supported
|
Action | public Action(String menuPath, String popupPath)(Code) | | creates new Action instance without API_MODE and SHORTCUT_MODE support
Parameters: menuPath - action path in main menu (use null value if menu mode is not supported) Parameters: popupPath - action path in popup menu (use null value if popup mode shell is not supported) |
Action | public Action(String menuPath, String popupPath, String systemActionClass)(Code) | | creates new Action instance without SHORTCUT_MODE support
Parameters: menuPath - action path in main menu (use null value if menu mode is not supported) Parameters: popupPath - action path in popup menu (use null value if popup mode is not supported) Parameters: systemActionClass - String class name of SystemAction (use null value if API mode is not supported) |
Action | public Action(String menuPath, String popupPath, Shortcut[] shortcuts)(Code) | | creates new Action instance without API_MODE support
Parameters: shortcuts - array of Shortcut instances (use null value if shorcut mode is not supported) Parameters: menuPath - action path in main menu (use null value if menu mode is not supported) Parameters: popupPath - action path in popup menu (use null value if popup mode shell is not supported) |
Action | public Action(String menuPath, String popupPath, Shortcut shortcut)(Code) | | creates new Action instance without API_MODE support
Parameters: shortcut - Shortcut (use null value if menu mode is not supported) Parameters: menuPath - action path in main menu (use null value if menu mode is not supported) Parameters: popupPath - action path in popup menu (use null value if popup mode shell is not supported) |
Action | public Action(String menuPath, String popupPath, String systemActionClass, Shortcut[] shortcuts)(Code) | | creates new Action instance
Parameters: shortcuts - array of Shortcut instances (use null value if shortcut mode is not supported) Parameters: menuPath - action path in main menu (use null value if menu mode is not supported) Parameters: popupPath - action path in popup menu (use null value if popup mode is not supported) Parameters: systemActionClass - String class name of SystemAction (use null value if API mode is not supported) |
Action | public Action(String menuPath, String popupPath, String systemActionClass, Shortcut shortcut)(Code) | | creates new Action instance
Parameters: shortcut - Shortcut String (use null value if menu mode is not supported) Parameters: menuPath - action path in main menu (use null value if menu mode is not supported) Parameters: popupPath - action path in popup menu (use null value if popup mode is not supported) Parameters: systemActionClass - String class name of SystemAction (use null value if API mode is not supported) |
getComparator | public StringComparator getComparator()(Code) | | Gets comparator set for this action instance.
comparator set for this action instance. |
getMenuPath | public String getMenuPath()(Code) | | getter for main menu path
String main menu path (or null if not suported) |
getPopupPath | public String getPopupPath()(Code) | | getter for popup menu path
String popup menu path (or null if not suported) |
getShortcuts | public Shortcut[] getShortcuts()(Code) | | getter for array of shortcuts
Shortcut[] (or null if not suported) |
getSystemActionClass | public Class getSystemActionClass()(Code) | | getter for system action class
Class of system action (or null if not suported) |
isEnabled | public boolean isEnabled()(Code) | | Checks whether this action is enabled. If IDE system action class
is defined, it calls its isEnabled() method else if main menu path is
defined, it checks menu item is enabled. Otherwise it throws
UnsupportedOperationException.
true if this action is enabled; false otherwise |
isEnabled | public boolean isEnabled(Node[] nodes)(Code) | | Checks whether this action on given nodes is enabled. If IDE system action class
is defined, it calls its isEnabled() method. Nodes are selected first.
Else if popup menu path is defined, it checks menu item is enabled.
Otherwise it throws UnsupportedOperationException.
Parameters: nodes - array of nodes to be selected before a check true if this action is enabled; false otherwise |
isEnabled | public boolean isEnabled(Node node)(Code) | | Checks whether this action on given node is enabled. If IDE system action class
is defined, it calls its isEnabled() method. Node is selected first.
Else if popup menu path is defined, it checks menu item is enabled.
Otherwise it throws UnsupportedOperationException.
Parameters: node - node to be selected before a check true if this action is enabled; false otherwise |
isEnabled | public boolean isEnabled(ComponentOperator componentOperator)(Code) | | Checks whether this action is enabled for given ComponentOperator.
First it makes component visible and focused.
If IDE system action class is defined, it calls its isEnabled() method.
Else if main menu path is defined, it checks menu item is enabled.
Otherwise it throws UnsupportedOperationException.
Parameters: componentOperator - instance of ComponentOperator true if this action is enabled; false otherwise |
perform | public void perform()(Code) | | performs action depending on default mode,
calls performPopup(), performMenu() or performAPI(),
when default mode is not supported, others are tried
|
perform | public void perform(Node node)(Code) | | performs action depending on default mode,
calls performPopup(), performMenu() or performAPI(),
when default mode is not supported, others are tried
Parameters: node - node to be action performed on |
perform | public void perform(Node[] nodes)(Code) | | performs action depending on default mode,
calls performPopup(), performMenu() or performAPI(),
when default mode is not supported, others are tried
Parameters: nodes - nodes to be action performed on |
perform | public void perform(ComponentOperator component)(Code) | | performs action depending on default mode,
calls performPopup(), performMenu() or performAPI(),
when default mode is not supported, others are tried
Parameters: component - component to be action performed on |
performAPI | public void performAPI(Node node)(Code) | | performs action through API
Parameters: node - node to be action performed on throws: UnsupportedOperationException - when action does not support API mode |
performAPI | public void performAPI(Node[] nodes)(Code) | | performs action through API
Parameters: nodes - nodes to be action performed on throws: UnsupportedOperationException - when action does not support API mode |
performAPI | public void performAPI(ComponentOperator component)(Code) | | performs action through API
Parameters: component - component to be action performed on throws: UnsupportedOperationException - when action does not support API mode |
performMenu | public void performMenu(Node node)(Code) | | performs action through main menu
Parameters: node - node to be action performed on throws: UnsupportedOperationException - when action does not support menu mode |
performMenu | public void performMenu(Node[] nodes)(Code) | | performs action through main menu
Parameters: nodes - nodes to be action performed on throws: UnsupportedOperationException - when action does not support menu mode |
performMenu | public void performMenu(ComponentOperator component)(Code) | | performs action through main menu
Parameters: component - component to be action performed on throws: UnsupportedOperationException - when action does not support menu mode |
performPopup | public void performPopup(Node node)(Code) | | performs action through popup menu
Parameters: node - node to be action performed on throws: UnsupportedOperationException - when action does not support popup mode |
performPopup | public void performPopup(Node[] nodes)(Code) | | performs action through popup menu
Parameters: nodes - nodes to be action performed on throws: UnsupportedOperationException - when action does not support popup mode |
performPopup | public void performPopup(ComponentOperator component)(Code) | | performs action through popup menu
Parameters: component - component to be action performed on throws: UnsupportedOperationException - when action does not support popup mode |
performShortcut | public void performShortcut(Node node)(Code) | | performs action through shortcut
Parameters: node - node to be action performed on throws: UnsupportedOperationException - when action does not support shortcut mode |
performShortcut | public void performShortcut(Node[] nodes)(Code) | | performs action through shortcut
Parameters: nodes - nodes to be action performed on throws: UnsupportedOperationException - when action does not support shortcut mode |
performShortcut | public void performShortcut(ComponentOperator component)(Code) | | performs action through shortcut
Parameters: component - component to be action performed on throws: UnsupportedOperationException - when action does not support shortcut mode |
setComparator | public void setComparator(StringComparator comparator)(Code) | | Sets comparator fot this action. Comparator is used for all actions
after this method is called.
Parameters: comparator - new comparator to be set (e.g.new Operator.DefaultStringComparator(true, true);to search string item exactly and case sensitive) |
testNodes | protected void testNodes(Node[] nodes)(Code) | | tests if nodes are all from the same tree
Parameters: nodes - nodes throws: IllegalArgumentException - when given nodes does not pass |
|
|