|
|||||||||
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.module.AbstractModuleInfo
org.scijava.module.DefaultMutableModuleInfo
org.scijava.command.DynamicCommandInfo
public class DynamicCommandInfo
Helper class for maintaining a DynamicCommand
's associated
ModuleInfo
.
The CommandService
has a plain CommandInfo
object in its
index, populated from the DynamicCommand
's @Plugin
annotation. So this class adapts that object, delegating to it for the
UIDetails
methods. The plain CommandInfo
cannot be used
as-is, however, because we need to override the ModuleInfo
methods as
well as provide metadata manipulation functionality such as
MutableModuleInfo.addInput(ModuleItem)
.
Field Summary |
---|
Fields inherited from interface org.scijava.UIDetails |
---|
APPLICATION_MENU_ROOT |
Constructor Summary | |
---|---|
DynamicCommandInfo(CommandInfo info,
Class<? extends DynamicCommand> moduleClass)
|
Method Summary | ||
---|---|---|
boolean |
canCancel()
Gets whether the module condones cancellation. |
|
boolean |
canPreview()
Gets whether the module supports previews. |
|
String |
getDescription()
Gets a string describing the object. |
|
String |
getIconPath()
Gets the resource path to an icon representing the object. |
|
String |
getInitializer()
Gets the function that is called to initialize the module's values. |
|
protected Field |
getInputField(String name)
Gets the Field corresponding to the given @Parameter
annotated module input, or null if the input does not exist or was not
declared using the @Parameter mechanism. |
|
String |
getLabel()
Gets the name to appear in a UI, if applicable. |
|
MenuPath |
getMenuPath()
Gets the path to the object's suggested position in the menu structure. |
|
String |
getMenuRoot()
Gets the name of the menu structure to which the object belongs. |
|
|
getMutableInput(String name,
Class<T> type)
Gets the mutable input with the given name and type. |
|
|
getMutableOutput(String name,
Class<T> type)
Gets the mutable output with the given name and type. |
|
String |
getName()
Gets the unique name of the object. |
|
protected Field |
getOutputField(String name)
Gets the Field corresponding to the given @Parameter
annotated module output, or null if the output does not exist or was not
declared using the @Parameter mechanism. |
|
double |
getPriority()
Gets the sort priority of the object. |
|
List<ValidityProblem> |
getProblems()
Gets the list of problems encountered while initializing the object. |
|
String |
getSelectionGroup()
Gets the name of the selection group to which the object belongs. |
|
String |
getTitle()
Gets an appropriate title for the object, for use in a user interface. |
|
boolean |
isEnabled()
Gets whether the object should be enabled in the user interface. |
|
boolean |
isInteractive()
Gets whether the module is intended to be run interactively. |
|
boolean |
isSelectable()
Gets whether the object can be selected (e.g., checking and unchecking its menu item) in the user interface. |
|
boolean |
isSelected()
Gets whether the object is selected (e.g., its menu item is checked) in the user interface. |
|
boolean |
isValid()
Gets whether the object is completely valid (i.e., no problems during initialization). |
|
void |
setDescription(String description)
Sets a string describing the object. |
|
void |
setEnabled(boolean enabled)
Sets whether the object should be enabled in the user interface. |
|
void |
setIconPath(String iconPath)
Sets the resource path to an icon representing the object. |
|
void |
setLabel(String label)
Sets the name to appear in a UI, if applicable. |
|
void |
setMenuPath(MenuPath menuPath)
Sets the path to the object's suggested position in the menu structure. |
|
void |
setMenuRoot(String menuRoot)
Sets the name of the menu structure to which the object belongs. |
|
void |
setName(String name)
Sets the unique name of the object. |
|
void |
setPriority(double priority)
Sets the sort priority of the object. |
|
void |
setSelectable(boolean selectable)
Sets whether the object can be selected (e.g., checking and unchecking its menu item) in the user interface. |
|
void |
setSelected(boolean selected)
Sets whether the object is selected (e.g., its menu item is checked) in the user interface. |
|
void |
setSelectionGroup(String selectionGroup)
Sets the name of the selection group to which the object belongs. |
Methods inherited from class org.scijava.module.DefaultMutableModuleInfo |
---|
addInput, addOutput, createModule, getDelegateClassName, getModuleClass, loadDelegateClass, removeInput, removeOutput, setModuleClass |
Methods inherited from class org.scijava.module.AbstractModuleInfo |
---|
canRunHeadless, clearParameters, getIdentifier, getInput, getInput, getOutput, getOutput, inputList, inputMap, inputs, outputList, outputMap, outputs, parseParameters, registerInput, registerOutput, update |
Methods inherited from class org.scijava.AbstractUIDetails |
---|
compareTo, isVisible, setVisible, toString |
Methods inherited from class org.scijava.AbstractBasicDetails |
---|
get, is, set |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.scijava.module.ModuleInfo |
---|
canRunHeadless, getInput, getInput, getOutput, getOutput, inputs, outputs, update |
Methods inherited from interface org.scijava.UIDetails |
---|
isVisible, setVisible |
Methods inherited from interface org.scijava.BasicDetails |
---|
get, is, set |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Constructor Detail |
---|
public DynamicCommandInfo(CommandInfo info, Class<? extends DynamicCommand> moduleClass)
Method Detail |
---|
public <T> MutableModuleItem<T> getMutableInput(String name, Class<T> type)
If the input is not mutable (i.e., a MutableModuleItem
), a
ClassCastException
will be thrown. However, this method is always
safe to call for inputs declared using the @Parameter
notation of
Command
s; it is only unsafe when called to retrieve inputs added
dynamically using DefaultMutableModuleInfo.addInput(ModuleItem)
, where the
ModuleItem
in question was of unknown (i.e., potentially
non-mutable) origin.
ClassCastException
- if input is not a MutableModuleItem
.public <T> MutableModuleItem<T> getMutableOutput(String name, Class<T> type)
If the output is not mutable (i.e., a MutableModuleItem
), a
ClassCastException
will be thrown. However, this method is always
safe to call for outputs declared using the @Parameter
notation of
Command
s; it is only unsafe when called to retrieve outputs added
dynamically using DefaultMutableModuleInfo.addInput(ModuleItem)
, where the
ModuleItem
in question was of unknown (i.e., potentially
non-mutable) origin.
ClassCastException
- if output is not a MutableModuleItem
.protected Field getInputField(String name)
Field
corresponding to the given @Parameter
annotated module input, or null if the input does not exist or was not
declared using the @Parameter
mechanism.
protected Field getOutputField(String name)
Field
corresponding to the given @Parameter
annotated module output, or null if the output does not exist or was not
declared using the @Parameter
mechanism.
public boolean isInteractive()
ModuleInfo
Runnable.run()
being called whenever any of the values change.
isInteractive
in interface ModuleInfo
isInteractive
in class AbstractModuleInfo
public boolean canPreview()
ModuleInfo
Runnable.run()
. If this method returns false, then
calling Module.preview()
will have no effect.
canPreview
in interface ModuleInfo
canPreview
in class AbstractModuleInfo
public boolean canCancel()
ModuleInfo
Module.cancel()
will
have no effect.
canCancel
in interface ModuleInfo
canCancel
in class AbstractModuleInfo
public String getInitializer()
ModuleInfo
getInitializer
in interface ModuleInfo
getInitializer
in class AbstractModuleInfo
public String getTitle()
UIDetails
getTitle
in interface UIDetails
getTitle
in class AbstractModuleInfo
public MenuPath getMenuPath()
UIDetails
getMenuPath
in interface UIDetails
getMenuPath
in class AbstractUIDetails
public String getMenuRoot()
UIDetails
getMenuRoot
in interface UIDetails
getMenuRoot
in class AbstractUIDetails
public String getIconPath()
UIDetails
getIconPath
in interface UIDetails
getIconPath
in class AbstractUIDetails
public double getPriority()
Prioritized
getPriority
in interface Prioritized
getPriority
in class AbstractUIDetails
Priority
public boolean isSelectable()
UIDetails
isSelectable
in interface UIDetails
isSelectable
in class AbstractUIDetails
public String getSelectionGroup()
UIDetails
getSelectionGroup
in interface UIDetails
getSelectionGroup
in class AbstractUIDetails
public boolean isSelected()
UIDetails
isSelected
in interface UIDetails
isSelected
in class AbstractUIDetails
public boolean isEnabled()
UIDetails
isEnabled
in interface UIDetails
isEnabled
in class AbstractUIDetails
public void setMenuPath(MenuPath menuPath)
UIDetails
setMenuPath
in interface UIDetails
setMenuPath
in class AbstractUIDetails
public void setMenuRoot(String menuRoot)
UIDetails
setMenuRoot
in interface UIDetails
setMenuRoot
in class AbstractUIDetails
public void setIconPath(String iconPath)
UIDetails
setIconPath
in interface UIDetails
setIconPath
in class AbstractUIDetails
public void setPriority(double priority)
Prioritized
setPriority
in interface Prioritized
setPriority
in class AbstractUIDetails
Priority
public void setEnabled(boolean enabled)
UIDetails
setEnabled
in interface UIDetails
setEnabled
in class AbstractUIDetails
public void setSelectable(boolean selectable)
UIDetails
setSelectable
in interface UIDetails
setSelectable
in class AbstractUIDetails
public void setSelectionGroup(String selectionGroup)
UIDetails
setSelectionGroup
in interface UIDetails
setSelectionGroup
in class AbstractUIDetails
public void setSelected(boolean selected)
UIDetails
setSelected
in interface UIDetails
setSelected
in class AbstractUIDetails
public String getName()
BasicDetails
getName
in interface BasicDetails
getName
in class AbstractBasicDetails
public String getLabel()
BasicDetails
getLabel
in interface BasicDetails
getLabel
in class AbstractBasicDetails
public String getDescription()
BasicDetails
getDescription
in interface BasicDetails
getDescription
in class AbstractBasicDetails
public void setName(String name)
BasicDetails
setName
in interface BasicDetails
setName
in class AbstractBasicDetails
public void setLabel(String label)
BasicDetails
setLabel
in interface BasicDetails
setLabel
in class AbstractBasicDetails
public void setDescription(String description)
BasicDetails
setDescription
in interface BasicDetails
setDescription
in class AbstractBasicDetails
public boolean isValid()
Validated
isValid
in interface Validated
isValid
in class AbstractModuleInfo
public List<ValidityProblem> getProblems()
Validated
getProblems
in interface Validated
getProblems
in class AbstractModuleInfo
Validated.isValid()
returning true.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |