| org.eclipse.ui.actions.PartEventAction org.eclipse.ui.actions.RetargetAction
All known Subclasses: org.eclipse.ui.actions.LabelRetargetAction,
RetargetAction | public class RetargetAction extends PartEventAction implements ActionFactory.IWorkbenchAction(Code) | | A RetargetAction tracks the active part in the workbench.
Each RetargetAction has an ID. If the active part provides an action
handler for the ID the enable and check state of the RetargetAction
is determined from the enable and check state of the handler. If the
active part does not provide an action handler then this action is
disabled.
Note: instances of this class add themselves as listeners to their
action handler. It is important for the creator of a retarget action to call
dispose when the action is no longer needed. This will ensure that the
listener is removed.
This class may be instantiated. It is not intented to be subclassed.
since: 2.0 |
Constructor Summary | |
public | RetargetAction(String actionID, String text) Constructs a RetargetAction with the given action id and text. | public | RetargetAction(String actionID, String text, int style) Constructs a RetargetAction with the given action id, text and style. |
Method Summary | |
public void | dispose() Disposes of the action and any resources held. | public void | enableAccelerator(boolean b) Enables the accelerator for this action. | public int | getAccelerator() | public IAction | getActionHandler() Returns the action handler. | final public boolean | isHandled() | public void | partActivated(IWorkbenchPart part) A workbench part has been activated. | public void | partClosed(IWorkbenchPart part) A workbench part has been closed. | public void | partDeactivated(IWorkbenchPart part) A workbench part has been deactivated. | protected void | propagateChange(PropertyChangeEvent event) Either the action handler itself has changed, or the configured action
handlers on the action bars have changed. | public void | run() Invoked when an action occurs. | public void | runWithEvent(Event event) Invoked when an action occurs. | protected void | setActionHandler(IAction newHandler) Sets the action handler. | public void | setChecked(boolean checked) | public void | setHelpListener(HelpListener listener) The RetargetAction implementation of this method declared on
IAction stores the help listener in a local field. | final public String | toString() Returns a string representation of this action. |
RetargetAction | public RetargetAction(String actionID, String text)(Code) | | Constructs a RetargetAction with the given action id and text.
Parameters: actionID - the retargetable action id Parameters: text - the action's text, or null if there is no text |
RetargetAction | public RetargetAction(String actionID, String text, int style)(Code) | | Constructs a RetargetAction with the given action id, text and style.
Parameters: actionID - the retargetable action id Parameters: text - the action's text, or null if there is no text Parameters: style - one of AS_PUSH_BUTTON , AS_CHECK_BOX ,AS_DROP_DOWN_MENU , AS_RADIO_BUTTON , andAS_UNSPECIFIED since: 3.0 |
dispose | public void dispose()(Code) | | Disposes of the action and any resources held.
|
enableAccelerator | public void enableAccelerator(boolean b)(Code) | | Enables the accelerator for this action.
Parameters: b - the new enable state |
getAccelerator | public int getAccelerator()(Code) | | |
getActionHandler | public IAction getActionHandler()(Code) | | Returns the action handler. This method was made public in 3.0.
The current action handling this retargettable action. Thishandler will be null if there is no currenthandler. |
isHandled | final public boolean isHandled()(Code) | | |
partActivated | public void partActivated(IWorkbenchPart part)(Code) | | A workbench part has been activated. Try to connect
to it.
Parameters: part - the workbench part that has been activated |
partClosed | public void partClosed(IWorkbenchPart part)(Code) | | A workbench part has been closed.
Parameters: part - the workbench part that has been closed |
partDeactivated | public void partDeactivated(IWorkbenchPart part)(Code) | | A workbench part has been deactivated. Disconnect from it.
Parameters: part - the workbench part that has been deactivated |
propagateChange | protected void propagateChange(PropertyChangeEvent event)(Code) | | Either the action handler itself has changed, or the configured action
handlers on the action bars have changed. Update self.
|
run | public void run()(Code) | | Invoked when an action occurs.
|
runWithEvent | public void runWithEvent(Event event)(Code) | | Invoked when an action occurs.
|
setActionHandler | protected void setActionHandler(IAction newHandler)(Code) | | Sets the action handler.
|
setChecked | public void setChecked(boolean checked)(Code) | | |
setHelpListener | public void setHelpListener(HelpListener listener)(Code) | | The RetargetAction implementation of this method declared on
IAction stores the help listener in a local field. The
supplied listener is only used if there is no hanlder.
|
toString | final public String toString()(Code) | | Returns a string representation of this action.
A string representation of this action. since: 3.2 |
|
|