|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.scijava.module.AbstractModule
org.scijava.command.ModuleCommand
public abstract class ModuleCommand
An ImageJ command which implements Module
directly (rather than using
the CommandModule
adapter class). This is useful for commands which
want to inspect and manipulate their own inputs and outputs programmatically.
Constructor Summary | |
---|---|
ModuleCommand()
|
Method Summary | |
---|---|
void |
cancel(String reason)
Cancels the operation execution, with the given reason for doing so. |
String |
getCancelReason()
Gets a message describing why the operation was canceled. |
Context |
getContext()
Gets the application context to which the object belongs, or null if Contextual.setContext(Context) has not yet been called on this object. |
CommandInfo |
getInfo()
Gets metadata about this module. |
boolean |
isCanceled()
Gets whether the operation has been canceled. |
void |
setContext(Context context)
Sets the application context to which the object belongs. |
Methods inherited from class org.scijava.module.AbstractModule |
---|
cancel, getDelegateObject, getInput, getInputs, getOutput, getOutputs, initialize, isResolved, preview, setInput, setInputs, setOutput, setOutputs, setResolved |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.lang.Runnable |
---|
run |
Methods inherited from interface org.scijava.Contextual |
---|
context |
Constructor Detail |
---|
public ModuleCommand()
Method Detail |
---|
public CommandInfo getInfo()
Module
getInfo
in interface Module
public Context getContext()
Contextual
Contextual.setContext(Context)
has not yet been called on this object.
getContext
in interface Contextual
Contextual.context()
public void setContext(Context context)
Contextual
Typically this method simply delegates to Context.inject(Object)
,
and should be called only once to populate the context. Most contextual
objects do not support later alteration of the context, and will throw
IllegalStateException
if this method is invoked again.
setContext
in interface Contextual
Context.inject(Object)
,
for an example of how to implement this interface
public boolean isCanceled()
Cancelable
isCanceled
in interface Cancelable
public void cancel(String reason)
Cancelable
This method merely sets the operation status to canceled; it cannot
necessarily stop the operation itself. That is, it is the responsibility of
each individual operation to check Cancelable.isCanceled()
in a timely manner
during execution, and stop doing whatever it is doing if the flag has been
tripped.
cancel
in interface Cancelable
reason
- A message describing why the operation is being canceled.public String getCancelReason()
Cancelable
getCancelReason
in interface Cancelable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |