|
Eclipse Platform Release 3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.core.commands.common.EventManager
org.eclipse.jface.action.AbstractAction
org.eclipse.jface.action.Action
org.eclipse.debug.ui.actions.DebugCommandAction
public abstract class DebugCommandAction
Abstract base class for re-targeting actions which delegate execution to
IDebugCommandHandler handlers.
The specific type of IDebugCommandHandler is determined by the
abstract getCommandType() method.
This base class is an action which can be instantiated directly by views,
etc. In order to contribute an action using an extension point, a class
implementing IActionDelegate should be created first.
The delegate should then use a DebugCommandAction to implement
the needed functionality. The IActionDelegate must use setActionProxy(IAction)
specifying the workbench's action that is a proxy to the action delegate. This
way, the workbench action can be updated visually as needed.
Note: IDebugCommandHandler command typically act on the active
debug context as opposed to the active selection in view or window. The
action delegate should ignore the active window selection, and instead allow
the DebugCommandAction to update itself based on the active
debug context.
Clients may subclass this class.
IDebugCommandHandler| Field Summary |
|---|
| Fields inherited from interface org.eclipse.jface.action.IAction |
|---|
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT |
| Constructor Summary | |
|---|---|
DebugCommandAction()
Constructor |
|
| Method Summary | |
|---|---|
void |
debugContextChanged(DebugContextEvent event)
Notification the debug context has changed as specified by the given event. |
void |
dispose()
Clean up when removing |
protected IAction |
getActionProxy()
Returns the workbench proxy associated with this action or null
if none. |
protected abstract java.lang.Class |
getCommandType()
Returns the IDebugCommandHandler
command handler that type this action executes. |
protected IDebugContextService |
getDebugContextService()
Returns the context service this action linked to. |
abstract ImageDescriptor |
getDisabledImageDescriptor()
Returns the disabled image for this action as an image descriptor. |
abstract java.lang.String |
getHelpContextId()
Returns the help context id for this action or null if none. |
abstract ImageDescriptor |
getHoverImageDescriptor()
Returns the hover image for this action as an image descriptor. |
abstract java.lang.String |
getId()
Returns a unique identifier for this action, or null if it has
none. |
abstract ImageDescriptor |
getImageDescriptor()
Returns the image for this action as an image descriptor. |
protected boolean |
getInitialEnablement()
Returns whether this action should be enabled when initialized and there is no active debug context. |
abstract java.lang.String |
getText()
Returns the text for this action. |
abstract java.lang.String |
getToolTipText()
Returns the tool tip text for this action. |
void |
init(IWorkbenchPart part)
Initializes this action for a specific part. |
void |
init(IWorkbenchWindow window)
Initializes this action for a workbench window. |
protected void |
postExecute(IRequest request,
java.lang.Object[] targets)
This method is called after the completion of the execution of this command. |
void |
run()
The default implementation of this IAction method does
nothing. |
void |
runWithEvent(Event event)
The default implementation of this IAction method ignores
the event argument, and simply calls run(). |
void |
setActionProxy(IAction action)
Sets the current workbench action that is a proxy to an IActionDelegate
that is using this action to perform its actual work. |
void |
setEnabled(boolean enabled)
Sets the enabled state of this action. |
| Methods inherited from class org.eclipse.jface.action.Action |
|---|
convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getHelpListener, getMenuCreator, getStyle, isChecked, isEnabled, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText |
| Methods inherited from class org.eclipse.jface.action.AbstractAction |
|---|
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener |
| Methods inherited from class org.eclipse.core.commands.common.EventManager |
|---|
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.eclipse.jface.action.IAction |
|---|
addPropertyChangeListener, removePropertyChangeListener |
| Constructor Detail |
|---|
public DebugCommandAction()
| Method Detail |
|---|
public void setActionProxy(IAction action)
IActionDelegate
that is using this action to perform its actual work. This only needs to be called when
an IActionDelegate is using one of these actions to perform its
function.
action - workbench proxy action
protected void postExecute(IRequest request,
java.lang.Object[] targets)
request - The completed request object which was given to the
debug command handler.targets - Objects which were the targets of this actionprotected abstract java.lang.Class getCommandType()
IDebugCommandHandler
command handler that type this action executes.
IDebugCommandHandlerpublic void debugContextChanged(DebugContextEvent event)
IDebugContextListener
debugContextChanged in interface IDebugContextListenerevent - debug context eventIDebugContextListener.debugContextChanged(org.eclipse.debug.ui.contexts.DebugContextEvent)public void setEnabled(boolean enabled)
IAction
When an action is in the enabled state, the control associated with
it is active; triggering it will end up inkoking this action's
run method.
Fires a property change event for the ENABLED property
if the enabled state actually changes as a consequence.
setEnabled in interface IActionsetEnabled in class Actionenabled - true to enable, and
false to disableAction.setEnabled(boolean)public void init(IWorkbenchPart part)
part - workbench partpublic void init(IWorkbenchWindow window)
window - the windowprotected boolean getInitialEnablement()
false
is returned.
public void run()
ActionIAction method does
nothing. Subclasses should override this method if they do not need
information from the triggering event, or override
runWithEvent(Event) if they do.
run in interface IActionrun in class Actionpublic void runWithEvent(Event event)
ActionIAction method ignores
the event argument, and simply calls run(). Subclasses
should override this method if they need information from the triggering
event, or override run() if not.
runWithEvent in interface IActionrunWithEvent in class Actionevent - the SWT event which triggered this action being runpublic void dispose()
protected IDebugContextService getDebugContextService()
public abstract java.lang.String getHelpContextId()
null if none.
nullpublic abstract java.lang.String getId()
IActionnull if it has
none.
getId in interface IActiongetId in class Actionnull if nonepublic abstract java.lang.String getText()
IAction
This method is associated with the TEXT property;
property change events are reported when its value changes.
getText in interface IActiongetText in class Actionnull if noneIAction.TEXTpublic abstract java.lang.String getToolTipText()
IAction
This method is associated with the TOOL_TIP_TEXT property;
property change events are reported when its value changes.
getToolTipText in interface IActiongetToolTipText in class Actionnull if noneIAction.TOOL_TIP_TEXTpublic abstract ImageDescriptor getDisabledImageDescriptor()
IAction
This method is associated with the IMAGE property;
property change events are reported when its value changes.
getDisabledImageDescriptor in interface IActiongetDisabledImageDescriptor in class Actionnull if this action has no imageIAction.IMAGEpublic abstract ImageDescriptor getHoverImageDescriptor()
IAction
Hover images will be used on platforms that support changing the image
when the user hovers over the item. This method is associated with
the IMAGE property;
property change events are reported when its value changes.
getHoverImageDescriptor in interface IActiongetHoverImageDescriptor in class Actionnull if this action has no imageIAction.IMAGEpublic abstract ImageDescriptor getImageDescriptor()
IAction
This method is associated with the IMAGE property;
property change events are reported when its value changes.
getImageDescriptor in interface IActiongetImageDescriptor in class Actionnull if this action has no imageIAction.IMAGEprotected IAction getActionProxy()
null
if none. This is the workbench proxy to an IActionDelegate
that is using this action to perform its actual work. This is only used when
an IActionDelegate is using one of these actions to perform its
function.
null
|
Eclipse Platform Release 3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.