public class DynamicCommandInfo extends DefaultMutableModuleInfo
DynamicCommand's associated
ModuleInfo.
This class wraps a plain CommandInfo object (e.g. from the
CommandService's index, present due to an @Plugin annotation
on the DynamicCommand class), 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).
APPLICATION_MENU_ROOT| Constructor and Description |
|---|
DynamicCommandInfo(CommandInfo info,
Class<? extends DynamicCommand> moduleClass) |
| Modifier and Type | Method and Description |
|---|---|
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)
|
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.
|
<T> MutableModuleItem<T> |
getMutableInput(String name,
Class<T> type)
Gets the mutable input with the given name and type.
|
<T> MutableModuleItem<T> |
getMutableOutput(String name,
Class<T> type)
Gets the mutable output with the given name and type.
|
String |
getName()
Gets the name of the object.
|
protected Field |
getOutputField(String name)
|
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 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.
|
addInput, addOutput, getModuleClass, removeInput, removeOutput, setModuleClassclearParameters, getInput, getInput, getOutput, getOutput, inputList, inputMap, inputs, outputList, outputMap, outputs, parseParameters, registerInput, registerOutputisVisible, setVisible, toStringget, is, setclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateModule, getDelegateClassName, loadDelegateClasscanRunHeadless, getIdentifier, getInput, getInput, getLocation, getOutput, getOutput, getVersion, inputs, outputs, updatecompareTo, isVisible, setVisibleget, is, setpublic DynamicCommandInfo(CommandInfo info, Class<? extends DynamicCommand> moduleClass)
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.public boolean isInteractive()
ModuleInfoRunnable.run() being called whenever any of the values change.public boolean canPreview()
ModuleInfoRunnable.run(). If this method returns false, then
calling Module.preview() will have no effect.public boolean canCancel()
ModuleInfoModule.cancel() will
have no effect.public String getInitializer()
ModuleInfopublic String getTitle()
UIDetailspublic MenuPath getMenuPath()
UIDetailsgetMenuPath in interface UIDetailsgetMenuPath in class AbstractUIDetailspublic String getMenuRoot()
UIDetailsgetMenuRoot in interface UIDetailsgetMenuRoot in class AbstractUIDetailspublic String getIconPath()
UIDetailsgetIconPath in interface UIDetailsgetIconPath in class AbstractUIDetailspublic double getPriority()
PrioritizedgetPriority in interface PrioritizedgetPriority in class AbstractUIDetailsPrioritypublic boolean isSelectable()
UIDetailsisSelectable in interface UIDetailsisSelectable in class AbstractUIDetailspublic String getSelectionGroup()
UIDetailsgetSelectionGroup in interface UIDetailsgetSelectionGroup in class AbstractUIDetailspublic boolean isSelected()
UIDetailsisSelected in interface UIDetailsisSelected in class AbstractUIDetailspublic boolean isEnabled()
UIDetailsisEnabled in interface UIDetailsisEnabled in class AbstractUIDetailspublic void setMenuPath(MenuPath menuPath)
UIDetailssetMenuPath in interface UIDetailssetMenuPath in class AbstractUIDetailspublic void setMenuRoot(String menuRoot)
UIDetailssetMenuRoot in interface UIDetailssetMenuRoot in class AbstractUIDetailspublic void setIconPath(String iconPath)
UIDetailssetIconPath in interface UIDetailssetIconPath in class AbstractUIDetailspublic void setPriority(double priority)
PrioritizedsetPriority in interface PrioritizedsetPriority in class AbstractUIDetailsPrioritypublic void setEnabled(boolean enabled)
UIDetailssetEnabled in interface UIDetailssetEnabled in class AbstractUIDetailspublic void setSelectable(boolean selectable)
UIDetailssetSelectable in interface UIDetailssetSelectable in class AbstractUIDetailspublic void setSelectionGroup(String selectionGroup)
UIDetailssetSelectionGroup in interface UIDetailssetSelectionGroup in class AbstractUIDetailspublic void setSelected(boolean selected)
UIDetailssetSelected in interface UIDetailssetSelected in class AbstractUIDetailspublic String getLabel()
BasicDetailsgetLabel in interface BasicDetailsgetLabel in class AbstractBasicDetailspublic String getDescription()
BasicDetailsgetDescription in interface BasicDetailsgetDescription in class AbstractBasicDetailspublic void setLabel(String label)
BasicDetailssetLabel in interface BasicDetailssetLabel in class AbstractBasicDetailspublic void setDescription(String description)
BasicDetailssetDescription in interface BasicDetailssetDescription in class AbstractBasicDetailspublic String getName()
NamedgetName in interface NamedgetName in class AbstractBasicDetailspublic void setName(String name)
NamedsetName in interface NamedsetName in class AbstractBasicDetailspublic boolean isValid()
Validatedpublic List<ValidityProblem> getProblems()
ValidatedValidated.isValid() returning true.Copyright © 2015–2022 SciJava. All rights reserved.