Package org.eclipse.debug.ui.actions
Class DebugCommandHandler
- java.lang.Object
-
- org.eclipse.core.commands.common.EventManager
-
- org.eclipse.core.commands.AbstractHandler
-
- org.eclipse.debug.ui.actions.DebugCommandHandler
-
public abstract class DebugCommandHandler extends AbstractHandler
Abstract base class for re-targeting command framework handlers, which delegate execution toIDebugCommandHandlerhandlers. The specific type ofIDebugCommandHandleris determined by the abstractgetCommandType()method.Note: This class is not an implementation of the
IDebugCommandHandlerinterface, which was somewhat unfortunately named.IDebugCommandHandleris an interface that used only by the debugger plug-ins. This class implementsIHandlerinterface and is to be used with the platform commands framework.Clients may subclass this class.
- Since:
- 3.6
- See Also:
IDebugCommandHandler,IHandler
-
-
Constructor Summary
Constructors Constructor Description DebugCommandHandler()The constructor adds the handler as the
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddispose()Clean up when removingObjectexecute(ExecutionEvent event)Executes with the map of parameter values by name.protected abstract Class<?>getCommandType()Returns theIDebugCommandHandlercommand handler that type this action executes.protected booleangetInitialEnablement()Returns whether this action should be enabled when initialized and there is no active debug context.booleanisEnabled()Whether this handler is capable of executing at this time.protected voidpostExecute(IRequest request, Object[] targets)This method is called after the completion of the execution of this command.voidsetEnabled(Object evaluationContext)Called by the framework to allow the handler to update its enabled state by extracting the same information available at execution time.-
Methods inherited from class org.eclipse.core.commands.AbstractHandler
addHandlerListener, fireHandlerChanged, hasListeners, isHandled, removeHandlerListener, setBaseEnabled
-
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
-
-
-
-
Method Detail
-
setEnabled
public void setEnabled(Object evaluationContext)
Description copied from class:AbstractHandlerCalled by the framework to allow the handler to update its enabled state by extracting the same information available at execution time. Clients may override if they need to extract information from the application context.- Specified by:
setEnabledin interfaceIHandler2- Overrides:
setEnabledin classAbstractHandler- Parameters:
evaluationContext- the application context. May benull- See Also:
AbstractHandler.setBaseEnabled(boolean)
-
isEnabled
public boolean isEnabled()
Description copied from class:AbstractHandlerWhether this handler is capable of executing at this time. Subclasses may override this method. If clients override this method they should also consider overridingAbstractHandler.setEnabled(Object)so they can be notified about framework execution contexts.- Specified by:
isEnabledin interfaceIHandler- Overrides:
isEnabledin classAbstractHandler- Returns:
true- See Also:
AbstractHandler.setEnabled(Object),AbstractHandler.setBaseEnabled(boolean)
-
execute
public Object execute(ExecutionEvent event) throws ExecutionException
Description copied from interface:IHandlerExecutes with the map of parameter values by name.- Parameters:
event- An event containing all the information about the current state of the application; must not benull.- Returns:
- the result of the execution. Reserved for future use, must be
null. - Throws:
ExecutionException- if an exception occurred during execution.
-
postExecute
protected void postExecute(IRequest request, Object[] targets)
This method is called after the completion of the execution of this command. Extending classes may override this method to perform additional operation after command execution.- Parameters:
request- The completed request object which was given the the debug command handler.targets- Objects which were the targets of this action
-
getCommandType
protected abstract Class<?> getCommandType()
Returns theIDebugCommandHandlercommand handler that type this action executes.- Returns:
- command class.
- See Also:
IDebugCommandHandler
-
getInitialEnablement
protected boolean getInitialEnablement()
Returns whether this action should be enabled when initialized and there is no active debug context.- Returns:
- false, by default
-
dispose
public void dispose()
Clean up when removing- Specified by:
disposein interfaceIHandler- Overrides:
disposein classAbstractHandler
-
-