|
|||||||||
| 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
Commands; 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
Commands; 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()
ModuleInfoRunnable.run() being called whenever any of the values change.
isInteractive in interface ModuleInfoisInteractive in class AbstractModuleInfopublic boolean canPreview()
ModuleInfoRunnable.run(). If this method returns false, then
calling Module.preview() will have no effect.
canPreview in interface ModuleInfocanPreview in class AbstractModuleInfopublic boolean canCancel()
ModuleInfoModule.cancel() will
have no effect.
canCancel in interface ModuleInfocanCancel in class AbstractModuleInfopublic String getInitializer()
ModuleInfo
getInitializer in interface ModuleInfogetInitializer in class AbstractModuleInfopublic String getTitle()
UIDetails
getTitle in interface UIDetailsgetTitle in class AbstractModuleInfopublic MenuPath getMenuPath()
UIDetails
getMenuPath in interface UIDetailsgetMenuPath in class AbstractUIDetailspublic String getMenuRoot()
UIDetails
getMenuRoot in interface UIDetailsgetMenuRoot in class AbstractUIDetailspublic String getIconPath()
UIDetails
getIconPath in interface UIDetailsgetIconPath in class AbstractUIDetailspublic double getPriority()
Prioritized
getPriority in interface PrioritizedgetPriority in class AbstractUIDetailsPrioritypublic boolean isSelectable()
UIDetails
isSelectable in interface UIDetailsisSelectable in class AbstractUIDetailspublic String getSelectionGroup()
UIDetails
getSelectionGroup in interface UIDetailsgetSelectionGroup in class AbstractUIDetailspublic boolean isSelected()
UIDetails
isSelected in interface UIDetailsisSelected in class AbstractUIDetailspublic boolean isEnabled()
UIDetails
isEnabled in interface UIDetailsisEnabled in class AbstractUIDetailspublic void setMenuPath(MenuPath menuPath)
UIDetails
setMenuPath in interface UIDetailssetMenuPath in class AbstractUIDetailspublic void setMenuRoot(String menuRoot)
UIDetails
setMenuRoot in interface UIDetailssetMenuRoot in class AbstractUIDetailspublic void setIconPath(String iconPath)
UIDetails
setIconPath in interface UIDetailssetIconPath in class AbstractUIDetailspublic void setPriority(double priority)
Prioritized
setPriority in interface PrioritizedsetPriority in class AbstractUIDetailsPrioritypublic void setEnabled(boolean enabled)
UIDetails
setEnabled in interface UIDetailssetEnabled in class AbstractUIDetailspublic void setSelectable(boolean selectable)
UIDetails
setSelectable in interface UIDetailssetSelectable in class AbstractUIDetailspublic void setSelectionGroup(String selectionGroup)
UIDetails
setSelectionGroup in interface UIDetailssetSelectionGroup in class AbstractUIDetailspublic void setSelected(boolean selected)
UIDetails
setSelected in interface UIDetailssetSelected in class AbstractUIDetailspublic String getName()
BasicDetails
getName in interface BasicDetailsgetName in class AbstractBasicDetailspublic String getLabel()
BasicDetails
getLabel in interface BasicDetailsgetLabel in class AbstractBasicDetailspublic String getDescription()
BasicDetails
getDescription in interface BasicDetailsgetDescription in class AbstractBasicDetailspublic void setName(String name)
BasicDetails
setName in interface BasicDetailssetName in class AbstractBasicDetailspublic void setLabel(String label)
BasicDetails
setLabel in interface BasicDetailssetLabel in class AbstractBasicDetailspublic void setDescription(String description)
BasicDetails
setDescription in interface BasicDetailssetDescription in class AbstractBasicDetailspublic boolean isValid()
Validated
isValid in interface ValidatedisValid in class AbstractModuleInfopublic List<ValidityProblem> getProblems()
Validated
getProblems in interface ValidatedgetProblems in class AbstractModuleInfoValidated.isValid() returning true.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||