|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.AbstractAction oracle.ide.controls.ToggleAction oracle.ide.IdeAction
An IdeAction
is used when adding a menu and/or toobar button.
An action object is associated with a specific command. When a menu or
toolbar button is clicked on, the action determines the active view
and tells the view controller to handle the command.
An action may also have a controller associated with it. When this is the
case, the action uses this controller to execute the command. Otherwise,
it tries to use the active view controller.
When an action cannot find a controller, it uses the IDE controller.
In addition, actions can store additional information such as: extra data,
and a context.
Command
,
Controller
,
Serialized FormField Summary |
Fields inherited from class oracle.ide.controls.ToggleAction |
ACCELERATOR, ACTION, BUTTON_GROUP_NAME, CATEGORY, CONTEXT_INDEPENDENT_NAME, DISABLED_ICON, HIDDEN, MENU_WEIGHT, MENU_WEIGHT_UNASSIGNED, MNEMONIC, RADIO, STATE, TOGGLES, USER_DATA |
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 | |
protected |
IdeAction(java.lang.String name,
javax.swing.Icon icon)
Constructor. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent event)
This method is called when the user clicks on a menu or toolbar button associated with this action. |
void |
addController(Controller controller)
Adds the specified controller to the list of controllers that manage this IdeAction. |
static void |
addController(int actionID,
Controller controller)
Convenience method for looking up the specified IdeAction by its action ID and, if found, adding the specified controller to it. |
static IdeAction |
create(int cmdId,
java.lang.String cmdClass,
java.lang.String name)
Create an action without adding the newly created action to the action table. |
static IdeAction |
create(int cmdId,
java.lang.String cmdClass,
java.lang.String name,
java.lang.String sCategory,
java.lang.Integer mnemonic,
ArrayResourceBundle bundle,
int key,
java.lang.Object data,
boolean enabled)
Gets the action associated with the specified command if it already exits. |
static IdeAction |
create(int cmdId,
java.lang.String cmdClass,
java.lang.String name,
java.lang.String sCategory,
java.lang.Integer mnemonic,
javax.swing.Icon icon,
java.lang.Object data,
boolean enabled)
Create an action without adding the newly created action to the action table. |
static IdeAction |
create(int cmdId,
java.lang.String cmdClass,
java.lang.String name,
java.lang.String sCategory,
java.lang.Integer mnemonic,
java.util.ResourceBundle bundle,
java.lang.String key,
java.lang.Object data,
boolean enabled)
Gets the action associated with the specified command if it already exits. |
static IdeAction |
find(int cmdId)
Finds the action associated with the specified command if it already exists. |
static IdeAction[] |
findGroup(java.lang.String groupName)
Finds the actions associated with the specified groupName . |
static IdeAction |
get(int cmdId,
java.lang.String name,
java.lang.Integer mnemonic)
Gets the action associated with the specified command if it already exits. |
static IdeAction |
get(int cmdId,
java.lang.String cmdClass,
java.lang.String name)
Gets the action associated with the specified command if it already exits. |
static IdeAction |
get(int cmdId,
java.lang.String cmdClass,
java.lang.String name,
ArrayResourceBundle bundle,
int key)
Gets the action associated with the specified command if it already exits. |
static IdeAction |
get(int cmdId,
java.lang.String cmdClass,
java.lang.String name,
java.lang.String sCategory,
java.lang.Integer mnemonic,
ArrayResourceBundle bundle,
int key,
java.lang.Object data,
boolean enabled)
Gets the action associated with the specified command if it already exits. |
static IdeAction |
get(int cmdId,
java.lang.String cmdClass,
java.lang.String name,
java.lang.String sCategory,
java.lang.Integer mnemonic,
javax.swing.Icon icon,
java.lang.Object data,
boolean enabled)
Gets the action associated with the specified command if it already exits. |
static IdeAction |
get(int cmdId,
java.lang.String cmdClass,
java.lang.String name,
java.lang.String sCategory,
java.lang.Integer mnemonic,
java.util.ResourceBundle bundle,
java.lang.String key,
java.lang.Object data,
boolean enabled)
Gets the action associated with the specified command if it already exits. |
java.lang.String |
getCommand()
Gets the action command. |
int |
getCommandId()
Gets the action data. |
void |
performAction()
|
void |
performAction(Context context)
|
void |
putValueDirectly(java.lang.String key,
java.lang.Object value)
This method has the same effect of calling putValue, except that it does not propagate the value to any linked IdeAction. |
static void |
remove(int cmdId)
Removes the action associated with the specified command, if it exists, from the IdeActionMap. |
void |
removeController(Controller controller)
Removes the specified controller from the list of controllers that manage this IdeAction. |
static void |
removeController(int actionID,
Controller controller)
Convenience method for looking up the specified IdeAction by its action ID and, if found, removing the specified controller from it. |
void |
setCommand(java.lang.String command)
Sets the action command. |
void |
setCommandId(int commandId)
Sets the command id data. |
void |
updateAction()
|
void |
updateAction(Context context)
|
Methods inherited from class oracle.ide.controls.ToggleAction |
getBooleanValue, getMenuWeight, getState, getValue, isRadio, isToggle, itemStateChanged, setBooleanValue, setMenuWeight, setState |
Methods inherited from class javax.swing.AbstractAction |
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected IdeAction(java.lang.String name, javax.swing.Icon icon)
name
- the label to display in menu and/or toolbar button.icon
- the icon to display in menu and/or toolbar button.Method Detail |
public static IdeAction get(int cmdId, java.lang.String cmdClass, java.lang.String name)
cmdId
- command identifier. Must be unique. A unique identifier
can be generated using the method Ide.findOrCreateCmdID()
.cmdClass
- command class namename
- command label.
public static IdeAction get(int cmdId, java.lang.String cmdClass, java.lang.String name, ArrayResourceBundle bundle, int key)
cmdId
- command identifier. Must be unique. A unique identifier
can be generated using the method Ide.findOrCreateCmdID()
.cmdClass
- command class namename
- command label.bundle
- the resource bundle to be used to look up the icon
resource pointed to by the key
parameter.key
- resource key used to look up and load the icon resource.
public static IdeAction get(int cmdId, java.lang.String cmdClass, java.lang.String name, java.lang.String sCategory, java.lang.Integer mnemonic, javax.swing.Icon icon, java.lang.Object data, boolean enabled)
cmdId
- command identifier. Must be unique. A unique identifier
can be generated using the method Ide.findOrCreateCmdID()
.cmdClass
- command class name.name
- command label.sCategory
- the category this command belongs to. Categories group
actions functionally. Existing categories include: Code Editor, Debug,
Edit, File, Help, Model, Project, Run, Search, Tools, View, Window,
Others.mnemonic
- mnemonic to appear in the command label.icon
- name the icon to display along side label.data
- user data associated with this action.enabled
- indicates whether this action is available.
public static IdeAction get(int cmdId, java.lang.String cmdClass, java.lang.String name, java.lang.String sCategory, java.lang.Integer mnemonic, ArrayResourceBundle bundle, int key, java.lang.Object data, boolean enabled)
cmdId
- command identifier. Must be unique. A unique identifier
can be generated using the method Ide.findOrCreateCmdID()
.cmdClass
- command class name.name
- command label.sCategory
- the category this command belongs to. Categories group
actions functionally. Existing categories include: Code Editor, Debug,
Edit, File, Help, Model, Project, Run, Search, Tools, View, Window,
Others.mnemonic
- mnemonic to appear in the command label.bundle
- the resource bundle to be used to look up the icon
resource pointed to by the key
parameter.key
- resource key used to look up and load the icon resource.data
- user data associated with this action.enabled
- indicates whether this action is available.
public static IdeAction get(int cmdId, java.lang.String cmdClass, java.lang.String name, java.lang.String sCategory, java.lang.Integer mnemonic, java.util.ResourceBundle bundle, java.lang.String key, java.lang.Object data, boolean enabled)
cmdId
- command identifier. Must be unique. A unique identifier
can be generated using the method Ide.findOrCreateCmdID()
.cmdClass
- command class name.name
- command label.sCategory
- the category this command belongs to. Categories group
actions functionally. Existing categories include: Code Editor, Debug,
Edit, File, Help, Model, Project, Run, Search, Tools, View, Window,
Others.mnemonic
- mnemonic to appear in the command label.bundle
- the resource bundle to be used to look up the icon
resource pointed to by the key
parameter.key
- resource key used to look up and load the icon resource.data
- user data associated with this action.enabled
- indicates whether this action is available.
public static IdeAction get(int cmdId, java.lang.String name, java.lang.Integer mnemonic)
cmdId
- command identifier. Must be unique. A unique identifier
can be generated using the method Ide.findOrCreateCmdID()
.name
- command label.mnemonic
- mnemonic to appear in the command label.
public static IdeAction create(int cmdId, java.lang.String cmdClass, java.lang.String name)
cmdId
- command name identifier.cmdClass
- command class namename
- command label.
public static IdeAction create(int cmdId, java.lang.String cmdClass, java.lang.String name, java.lang.String sCategory, java.lang.Integer mnemonic, javax.swing.Icon icon, java.lang.Object data, boolean enabled)
cmdId
- command identifier. Must be unique. A unique identifier
can be generated using the method Ide.findOrCreateCmdID()
.cmdClass
- command class name.name
- command label.sCategory
- the category this command belongs to. Categories group
actions functionally. Existing categories include: Code Editor, Debug,
Edit, File, Help, Model, Project, Run, Search, Tools, View, Window,
Others.mnemonic
- mnemonic to appear in the command label.icon
- name the icon to display along side label.data
- user data associated with this action.enabled
- indicates whether this action is available.
public static IdeAction create(int cmdId, java.lang.String cmdClass, java.lang.String name, java.lang.String sCategory, java.lang.Integer mnemonic, ArrayResourceBundle bundle, int key, java.lang.Object data, boolean enabled)
cmdId
- command identifier. Must be unique. A unique identifier
can be generated using the method Ide.findOrCreateCmdID()
.cmdClass
- command class name.name
- command label.sCategory
- the category this command belongs to. Categories group
actions functionally. Existing categories include: Code Editor, Debug,
Edit, File, Help, Model, Project, Run, Search, Tools, View, Window,
Others.mnemonic
- mnemonic to appear in the command label.bundle
- the resource bundle to be used to look up the icon
resource pointed to by the key
parameter.key
- resource key used to look up and load the icon resource.data
- user data associated with this action.enabled
- indicates whether this action is available.
public static IdeAction create(int cmdId, java.lang.String cmdClass, java.lang.String name, java.lang.String sCategory, java.lang.Integer mnemonic, java.util.ResourceBundle bundle, java.lang.String key, java.lang.Object data, boolean enabled)
cmdId
- command identifier. Must be unique. A unique identifier
can be generated using the method Ide.findOrCreateCmdID()
.cmdClass
- command class name.name
- command label.sCategory
- the category this command belongs to. Categories group
actions functionally. Existing categories include: Code Editor, Debug,
Edit, File, Help, Model, Project, Run, Search, Tools, View, Window,
Others.mnemonic
- mnemonic to appear in the command label.bundle
- the resource bundle to be used to look up the icon
resource pointed to by the key
parameter.key
- resource key used to look up and load the icon resource.data
- user data associated with this action.enabled
- indicates whether this action is available.
public static IdeAction find(int cmdId)
cmdId
- command name identifier.
public static void remove(int cmdId)
cmdId
- command name identifier.public static IdeAction[] findGroup(java.lang.String groupName)
groupName
.
groupName
- identifies the group whose actions want to be found.
public final void actionPerformed(java.awt.event.ActionEvent event)
event
- an action event.public final void performAction() throws java.lang.Exception
java.lang.Exception
public final void performAction(Context context) throws java.lang.Exception
java.lang.Exception
public final void updateAction()
public final void updateAction(Context context)
public final void addController(Controller controller)
public static final void addController(int actionID, Controller controller)
public final void removeController(Controller controller)
public static final void removeController(int actionID, Controller controller)
public final java.lang.String getCommand()
public final void setCommand(java.lang.String command)
command
- the action command.public final void setCommandId(int commandId)
commandId
- command id.public final int getCommandId()
public final void putValueDirectly(java.lang.String key, java.lang.Object value)
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.