|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.scijava.AbstractBasicDetails
org.scijava.AbstractUIDetails
org.scijava.plugin.PluginInfo<Command>
org.scijava.command.CommandInfo
public class CommandInfo
A collection of metadata about a particular Command.
Unlike its more general superclass PluginInfo, a CommandInfo
implements ModuleInfo, allowing it to describe and instantiate the
command in Module form.
- The interface which provides many methods for interrogating
structural details of a {@link Module}.,
- An adapter class that bridges the gap between ImageJ
commands and the rich {@link Module} interface.| Field Summary |
|---|
| Fields inherited from interface org.scijava.UIDetails |
|---|
APPLICATION_MENU_ROOT |
| Constructor Summary | |
|---|---|
|
CommandInfo(Class<? extends Command> commandClass)
Creates a new command metadata object. |
|
CommandInfo(Class<? extends Command> commandClass,
Plugin annotation)
Creates a new command metadata object. |
|
CommandInfo(PluginInfo<Command> info)
Creates a new command metadata object describing the same command as the given PluginInfo. |
protected |
CommandInfo(PluginInfo<Command> info,
String className,
Class<? extends Command> commandClass,
Plugin annotation)
|
|
CommandInfo(String className)
Creates a new command metadata object. |
|
CommandInfo(String className,
Plugin annotation)
Creates a new command metadata object. |
| Method Summary | ||
|---|---|---|
boolean |
canCancel()
Gets whether the module condones cancellation. |
|
boolean |
canPreview()
Gets whether the module supports previews. |
|
boolean |
canRunHeadless()
Gets whether the module condones headless execution. |
|
Command |
createInstance()
Creates an object. |
|
Module |
createModule()
Instantiates the module described by this module info. |
|
Module |
createModule(Command commandInstance)
Instantiates the module described by this module info, around the specified existing command instance. |
|
String |
getClassName()
Gets the fully qualified name of the Class of the objects that can
be created. |
|
String |
getDelegateClassName()
Gets the fully qualified name of the class containing the module's actual implementation. |
|
URL |
getIconURL()
Gets the URL corresponding to the icon resource path. |
|
String |
getIdentifier()
Gets a string intended to function as an identifier for the object. |
|
String |
getInitializer()
Gets the function that is called to initialize the module's values. |
|
CommandModuleItem<?> |
getInput(String name)
Gets the input item with the given name. |
|
|
getInput(String name,
Class<T> type)
Gets the input item with the given name and type. |
|
CommandModuleItem<?> |
getOutput(String name)
Gets the output item with the given name. |
|
|
getOutput(String name,
Class<T> type)
Gets the output item with the given name and type. |
|
Class<? extends Command> |
getPluginClass()
Obtains the Class of the item objects, if that class has already
been loaded. |
|
Map<String,Object> |
getPresets()
Gets the table of items with fixed, preset values. |
|
List<ValidityProblem> |
getProblems()
Gets the list of problems encountered while initializing the object. |
|
String |
getTitle()
Gets an appropriate title for the object, for use in a user interface. |
|
Iterable<ModuleItem<?>> |
inputs()
Gets the list of input items. |
|
boolean |
isInteractive()
Gets whether the module is intended to be run interactively. |
|
boolean |
isValid()
Gets whether the object is completely valid (i.e., no problems during initialization). |
|
Class<? extends Command> |
loadClass()
Loads the class corresponding to the objects that are created by Instantiable.createInstance(). |
|
Class<?> |
loadDelegateClass()
Loads the class containing the module's actual implementation. |
|
Iterable<ModuleItem<?>> |
outputs()
Gets the list of output items. |
|
void |
setPluginClass(Class<? extends Command> pluginClass)
Explicitly sets the Class of the item objects. |
|
void |
setPresets(Map<String,Object> presets)
Sets the table of items with fixed, preset values. |
|
String |
toString()
|
|
void |
update(EventService eventService)
Notifies interested parties that the module info has been modified. |
|
| Methods inherited from class org.scijava.plugin.PluginInfo |
|---|
getAnnotation, getPluginType, inject, setPluginType |
| Methods inherited from class org.scijava.AbstractUIDetails |
|---|
compareTo, getIconPath, getMenuPath, getMenuRoot, getPriority, getSelectionGroup, isEnabled, isSelectable, isSelected, isVisible, setEnabled, setIconPath, setMenuPath, setMenuRoot, setPriority, setSelectable, setSelected, setSelectionGroup, setVisible |
| Methods inherited from class org.scijava.AbstractBasicDetails |
|---|
get, getDescription, getLabel, getName, is, set, setDescription, setLabel, setName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.scijava.UIDetails |
|---|
getIconPath, getMenuPath, getMenuRoot, getSelectionGroup, isEnabled, isSelectable, isSelected, isVisible, setEnabled, setIconPath, setMenuPath, setMenuRoot, setSelectable, setSelected, setSelectionGroup, setVisible |
| Methods inherited from interface org.scijava.BasicDetails |
|---|
get, getDescription, getLabel, getName, is, set, setDescription, setLabel, setName |
| Methods inherited from interface org.scijava.Prioritized |
|---|
getPriority, setPriority |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Constructor Detail |
|---|
public CommandInfo(String className)
className - The name of the class, which must implement
Command.
public CommandInfo(String className,
Plugin annotation)
className - The name of the class, which must implement
Command.annotation - The @Plugin annotation to associate with this
metadata object.public CommandInfo(Class<? extends Command> commandClass)
commandClass - The plugin class, which must implement Command.
public CommandInfo(Class<? extends Command> commandClass,
Plugin annotation)
commandClass - The plugin class, which must implement Command.annotation - The @Plugin annotation to associate with this
metadata object.public CommandInfo(PluginInfo<Command> info)
PluginInfo.
info - The plugin metadata to wrap.
protected CommandInfo(PluginInfo<Command> info,
String className,
Class<? extends Command> commandClass,
Plugin annotation)
| Method Detail |
|---|
public void setPresets(Map<String,Object> presets)
public Map<String,Object> getPresets()
public Module createModule(Command commandInstance)
public void setPluginClass(Class<? extends Command> pluginClass)
PluginInfoClass of the item objects.
This is useful if your class is produced by something other than the system classloader.
setPluginClass in class PluginInfo<Command>public Class<? extends Command> getPluginClass()
PluginInfoClass of the item objects, if that class has already
been loaded.
getPluginClass in class PluginInfo<Command>Class, or null if it has not yet been loaded by
PluginInfo.loadClass().
public URL getIconURL()
throws InstantiableException
PluginInfo
getIconURL in class PluginInfo<Command>InstantiableExceptionAbstractUIDetails.getIconPath()public String toString()
toString in class PluginInfo<Command>public String getClassName()
InstantiableClass of the objects that can
be created.
getClassName in interface Instantiable<Command>getClassName in class PluginInfo<Command>
public Class<? extends Command> loadClass()
throws InstantiableException
InstantiableInstantiable.createInstance().
Note that this class may not be precisely T.class but instead a
subclass thereof.
loadClass in interface Instantiable<Command>loadClass in class PluginInfo<Command>InstantiableExceptionfor an example of an
{@code Instantiable} type that typically instantiates objects of a
subtype of {@code T} rather than {@code T} itself.
public Command createInstance()
throws InstantiableException
Instantiable
createInstance in interface Instantiable<Command>createInstance in class PluginInfo<Command>InstantiableExceptionpublic CommandModuleItem<?> getInput(String name)
ModuleInfo
getInput in interface ModuleInfo
public <T> CommandModuleItem<T> getInput(String name,
Class<T> type)
ModuleInfo
getInput in interface ModuleInfopublic CommandModuleItem<?> getOutput(String name)
ModuleInfo
getOutput in interface ModuleInfo
public <T> CommandModuleItem<T> getOutput(String name,
Class<T> type)
ModuleInfo
getOutput in interface ModuleInfopublic Iterable<ModuleItem<?>> inputs()
ModuleInfo
inputs in interface ModuleInfopublic Iterable<ModuleItem<?>> outputs()
ModuleInfo
outputs in interface ModuleInfopublic String getDelegateClassName()
ModuleInfocreateModule().getDelegateObject().getClass().getName(), and hence
is also the class containing any callback methods specified by
ModuleItem.getCallback().
The nature of this method is implementation-specific; for example, a
CommandModule will return the class name of its associated
Command. For modules that are not commands, the result may be
something else.
If you are implementing this interface directly, a good rule of thumb is to
return the class name of the associated Module (i.e., the same
value given by createModule().getClass().getName()).
getDelegateClassName in interface ModuleInfo
public Class<?> loadDelegateClass()
throws ClassNotFoundException
ModuleInfoModuleInfo.getDelegateClassName().
loadDelegateClass in interface ModuleInfoClassNotFoundExceptionInstantiable.loadClass()
public Module createModule()
throws ModuleException
ModuleInfo
createModule in interface ModuleInfoModuleExceptionpublic boolean isInteractive()
ModuleInfoRunnable.run() being called whenever any of the values change.
isInteractive in interface ModuleInfopublic boolean canPreview()
ModuleInfoRunnable.run(). If this method returns false, then
calling Module.preview() will have no effect.
canPreview in interface ModuleInfopublic boolean canCancel()
ModuleInfoModule.cancel() will
have no effect.
canCancel in interface ModuleInfopublic boolean canRunHeadless()
ModuleInfo
canRunHeadless in interface ModuleInfopublic String getInitializer()
ModuleInfo
getInitializer in interface ModuleInfopublic void update(EventService eventService)
ModuleInfo
For classes implementing this interface directly, this method should
publish a ModulesUpdatedEvent to the event bus (see
AbstractModuleInfo.update(EventService) for an example).
update in interface ModuleInfopublic String getTitle()
UIDetails
getTitle in interface UIDetailsgetTitle in class AbstractUIDetailspublic boolean isValid()
Validated
isValid in interface Validatedpublic List<ValidityProblem> getProblems()
Validated
getProblems in interface ValidatedValidated.isValid() returning true.public String getIdentifier()
Identifiable
getIdentifier in interface Identifiable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||