|
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.debug.core.commands.AbstractDebugCommand
public abstract class AbstractDebugCommand
Abstract implementation of a debug command handler. Handles IDebugCommandRequest
and IEnabledStateRequest
updates asynchronously using jobs.
Clients may subclass this class.
Constructor Summary | |
---|---|
AbstractDebugCommand()
|
Method Summary | |
---|---|
void |
canExecute(IEnabledStateRequest request)
Determines whether this handler can execute on the elements specified in the given request by reporting enabled state to the request. |
protected abstract void |
doExecute(Object[] targets,
IProgressMonitor monitor,
IRequest request)
Executes this command synchronously on the specified targets, reporting progress. |
boolean |
execute(IDebugCommandRequest request)
Executes this command on the elements specified in the given request reporting status to the given request and returns whether this handler should remain enabled while the command is executing. |
protected Object |
getAdapter(Object element,
Class type)
Convenience method to return an adapter of the specified type for the given object or null
if none. |
protected Object |
getEnabledStateJobFamily(IDebugCommandRequest request)
Returns the job family for the this command's IEnabledStateRequest update job
or null if none. |
protected ISchedulingRule |
getEnabledStateSchedulingRule(IDebugCommandRequest request)
Returns a scheduling rule for this command's IEnabledStateRequest update job
or null if none. |
protected String |
getEnabledStateTaskName()
Returns the name to use for a job and progress monitor task names when performing an IEnabledStateRequest . |
protected Object |
getExecuteJobFamily(IDebugCommandRequest request)
Returns the job family for the this command's IDebugCommandRequest execute job
or null if none. |
protected ISchedulingRule |
getExecuteSchedulingRule(IDebugCommandRequest request)
Returns a scheduling rule for this command's IDebugCommandRequest execute job
or null if none. |
protected String |
getExecuteTaskName()
Returns the name to use for jobs and progress monitor task names when executing an IDebugCommandRequest . |
protected abstract Object |
getTarget(Object element)
Returns the appropriate target for this command handler for the given object. |
protected abstract boolean |
isExecutable(Object[] targets,
IProgressMonitor monitor,
IEnabledStateRequest request)
Returns whether this command is executable on the specified targets, reporting progress. |
protected boolean |
isRemainEnabled(IDebugCommandRequest request)
Returns whether this command should remain enabled after starting execution of the specified request. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractDebugCommand()
Method Detail |
---|
public boolean execute(IDebugCommandRequest request)
IDebugCommandHandler
Implementations must be non-blocking and may respond asynchronously to the
given request. Errors can reported by setting an appropriate status
on the given request. A request can be canceled by this handler or the caller.
A null
status is equivalent to an OK status. When a request is
complete, has encountered an error, or canceled, implementations must call
done()
on the given collector.
Handlers are expected to poll the request (using isCanceled
)
periodically and abort at their earliest convenience calling done()
on the request.
execute
in interface IDebugCommandHandler
request
- specifies elements to operate on and collects execution status
protected boolean isRemainEnabled(IDebugCommandRequest request)
request
- the request being executed
public void canExecute(IEnabledStateRequest request)
IDebugCommandHandler
Implementations must be non-blocking and may respond asynchronously to the
given request. Errors can reported by setting an appropriate status
on the given request. A request can be canceled by this handler or caller.
A null
status is equivalent to an OK status.
When a request succeeds, fails, or is canceled, implementations must call
done()
on the given request.
Clients are expected to poll the request (using isCanceled
)
periodically and abort at their earliest convenience calling done()
on the request.
canExecute
in interface IDebugCommandHandler
request
- specifies elements to operate on and collects enabled stateprotected String getEnabledStateTaskName()
IEnabledStateRequest
.
protected String getExecuteTaskName()
IDebugCommandRequest
.
protected abstract void doExecute(Object[] targets, IProgressMonitor monitor, IRequest request) throws CoreException
Handlers must override this method.
targets
- objects to perform this command onmonitor
- progress monitorrequest
- can be used to cancel this command
CoreException
- if this handler fails to perform the requestprotected abstract boolean isExecutable(Object[] targets, IProgressMonitor monitor, IEnabledStateRequest request) throws CoreException
false
if the request is canceled.
Handlers must override this method.
targets
- objects to check command enabled state formonitor
- progress monitorrequest
- can be used to cancel this update request
CoreException
protected abstract Object getTarget(Object element)
doExecute(Object[], IProgressMonitor, IRequest)
and isExecutable(Object[], IProgressMonitor, IEnabledStateRequest)
.
The target may be the element itself, or some other object. Allows for redirection.
Clients must override this method.
element
- element from a IDebugCommandRequest
null
.protected Object getAdapter(Object element, Class type)
null
if none.
element
- element to retrieve adapter fortype
- adapter type
null
protected ISchedulingRule getEnabledStateSchedulingRule(IDebugCommandRequest request)
IEnabledStateRequest
update job
or null
if none. By default a rule is created to serialize
jobs on the first element in the request.
Clients may override this method as required.
request
- request that a scheduling rule is required for
null
protected ISchedulingRule getExecuteSchedulingRule(IDebugCommandRequest request)
IDebugCommandRequest
execute job
or null
if none. By default, execution jobs have no scheduling rule.
Clients may override this method as required.
request
- request that a scheduling rule is required for
null
protected Object getEnabledStateJobFamily(IDebugCommandRequest request)
IEnabledStateRequest
update job
or null
if none. The default implementation returns null
.
Clients may override this method as required.
request
- request the job family is required for
null
if noneprotected Object getExecuteJobFamily(IDebugCommandRequest request)
IDebugCommandRequest
execute job
or null
if none. The default implementation returns null
.
Clients may override this method as required.
request
- request the job family is required for
null
if none
|
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.