Package org.scijava.command
Class CommandModuleItem<T>
- java.lang.Object
-
- org.scijava.AbstractBasicDetails
-
- org.scijava.module.AbstractModuleItem<T>
-
- org.scijava.command.CommandModuleItem<T>
-
- All Implemented Interfaces:
BasicDetails,ModuleItem<T>,Named
public class CommandModuleItem<T> extends AbstractModuleItem<T>
ModuleItemimplementation describing an input or output of a command.- Author:
- Curtis Rueden
-
-
Constructor Summary
Constructors Constructor Description CommandModuleItem(ModuleInfo info, Field field)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringget(String key)Gets the value of the given key, or null if undefined.StringgetCallback()Gets the function that is called whenever this item changes.List<T>getChoices()Gets the list of possible values.intgetColumnCount()Gets the preferred width of the input field in characters (if applicable).TgetDefaultValue()Gets the default value.StringgetDescription()Gets a string describing the object.FieldgetField()TypegetGenericType()Gets the type of the item, including Java generic parameters.StringgetInitializer()Gets the function that is called to initialize the item's value.ItemIOgetIOType()Gets the input/output type of the item.StringgetLabel()Gets the name to appear in a UI, if applicable.TgetMaximumValue()Gets the maximum allowed value (if applicable).TgetMinimumValue()Gets the minimum allowed value (if applicable).StringgetName()Gets the name of the object.ParametergetParameter()StringgetPersistKey()Gets the key to use for saving the value persistently.NumbergetStepSize()Gets the preferred step size to use when rendering the item in a user interface (if applicable).Class<T>getType()Gets the type of the item.StringgetValidater()Gets the function that is called to validate the item's value.ItemVisibilitygetVisibility()Gets the visibility of the item.StringgetWidgetStyle()Gets the preferred widget style to use when rendering the item in a user interface.booleanis(String key)Returns true iff the given key is defined.booleanisAutoFill()Gets whether the item value is allowed to be auto-filled.booleanisPersisted()Gets whether to remember the most recent value of the parameter.booleanisRequired()Gets whether the item value must be specified (i.e., no default).-
Methods inherited from class org.scijava.module.AbstractModuleItem
callback, getDelegateClass, getInfo, getSoftMaximum, getSoftMinimum, getValue, initialize, isInput, isOutput, loadValue, saveValue, setValue, toString, validate
-
Methods inherited from class org.scijava.AbstractBasicDetails
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.BasicDetails
set, setDescription, setLabel
-
Methods inherited from interface org.scijava.module.ModuleItem
validateMessage
-
-
-
-
Constructor Detail
-
CommandModuleItem
public CommandModuleItem(ModuleInfo info, Field field)
-
-
Method Detail
-
getField
public Field getField()
-
getParameter
public Parameter getParameter()
-
getType
public Class<T> getType()
Description copied from interface:ModuleItemGets the type of the item.
-
getGenericType
public Type getGenericType()
Description copied from interface:ModuleItemGets the type of the item, including Java generic parameters.For many modules, this may be the same
Classobject returned byModuleItem.getType(), but some module inputs or outputs may be backed by a generic type such asList<String>orIterable<Integer>.- Specified by:
getGenericTypein interfaceModuleItem<T>- Overrides:
getGenericTypein classAbstractModuleItem<T>- See Also:
Field.getGenericType()
-
getIOType
public ItemIO getIOType()
Description copied from interface:ModuleItemGets the input/output type of the item.- Specified by:
getIOTypein interfaceModuleItem<T>- Overrides:
getIOTypein classAbstractModuleItem<T>
-
getVisibility
public ItemVisibility getVisibility()
Description copied from interface:ModuleItemGets the visibility of the item.- Specified by:
getVisibilityin interfaceModuleItem<T>- Overrides:
getVisibilityin classAbstractModuleItem<T>
-
isAutoFill
public boolean isAutoFill()
Description copied from interface:ModuleItemGets whether the item value is allowed to be auto-filled.- Specified by:
isAutoFillin interfaceModuleItem<T>- Overrides:
isAutoFillin classAbstractModuleItem<T>
-
isRequired
public boolean isRequired()
Description copied from interface:ModuleItemGets whether the item value must be specified (i.e., no default).- Specified by:
isRequiredin interfaceModuleItem<T>- Overrides:
isRequiredin classAbstractModuleItem<T>
-
isPersisted
public boolean isPersisted()
Description copied from interface:ModuleItemGets whether to remember the most recent value of the parameter.- Specified by:
isPersistedin interfaceModuleItem<T>- Overrides:
isPersistedin classAbstractModuleItem<T>
-
getPersistKey
public String getPersistKey()
Description copied from interface:ModuleItemGets the key to use for saving the value persistently.- Specified by:
getPersistKeyin interfaceModuleItem<T>- Overrides:
getPersistKeyin classAbstractModuleItem<T>
-
getInitializer
public String getInitializer()
Description copied from interface:ModuleItemGets the function that is called to initialize the item's value.- Specified by:
getInitializerin interfaceModuleItem<T>- Overrides:
getInitializerin classAbstractModuleItem<T>
-
getValidater
public String getValidater()
Description copied from interface:ModuleItemGets the function that is called to validate the item's value.- Specified by:
getValidaterin interfaceModuleItem<T>- Overrides:
getValidaterin classAbstractModuleItem<T>
-
getCallback
public String getCallback()
Description copied from interface:ModuleItemGets the function that is called whenever this item changes.This mechanism enables interdependent items of various types. For example, two int parameters "width" and "height" could update each other when another boolean "Preserve aspect ratio" flag is set.
- Specified by:
getCallbackin interfaceModuleItem<T>- Overrides:
getCallbackin classAbstractModuleItem<T>
-
getWidgetStyle
public String getWidgetStyle()
Description copied from interface:ModuleItemGets the preferred widget style to use when rendering the item in a user interface.- Specified by:
getWidgetStylein interfaceModuleItem<T>- Overrides:
getWidgetStylein classAbstractModuleItem<T>
-
getMinimumValue
public T getMinimumValue()
Description copied from interface:ModuleItemGets the minimum allowed value (if applicable).- Specified by:
getMinimumValuein interfaceModuleItem<T>- Overrides:
getMinimumValuein classAbstractModuleItem<T>
-
getMaximumValue
public T getMaximumValue()
Description copied from interface:ModuleItemGets the maximum allowed value (if applicable).- Specified by:
getMaximumValuein interfaceModuleItem<T>- Overrides:
getMaximumValuein classAbstractModuleItem<T>
-
getDefaultValue
public T getDefaultValue()
Description copied from interface:ModuleItemGets the default value.- Specified by:
getDefaultValuein interfaceModuleItem<T>- Overrides:
getDefaultValuein classAbstractModuleItem<T>
-
getStepSize
public Number getStepSize()
Description copied from interface:ModuleItemGets the preferred step size to use when rendering the item in a user interface (if applicable).- Specified by:
getStepSizein interfaceModuleItem<T>- Overrides:
getStepSizein classAbstractModuleItem<T>
-
getColumnCount
public int getColumnCount()
Description copied from interface:ModuleItemGets the preferred width of the input field in characters (if applicable).- Specified by:
getColumnCountin interfaceModuleItem<T>- Overrides:
getColumnCountin classAbstractModuleItem<T>
-
getChoices
public List<T> getChoices()
Description copied from interface:ModuleItemGets the list of possible values.- Specified by:
getChoicesin interfaceModuleItem<T>- Overrides:
getChoicesin classAbstractModuleItem<T>
-
getLabel
public String getLabel()
Description copied from interface:BasicDetailsGets the name to appear in a UI, if applicable.- Specified by:
getLabelin interfaceBasicDetails- Overrides:
getLabelin classAbstractBasicDetails
-
getDescription
public String getDescription()
Description copied from interface:BasicDetailsGets a string describing the object.- Specified by:
getDescriptionin interfaceBasicDetails- Overrides:
getDescriptionin classAbstractBasicDetails
-
is
public boolean is(String key)
Description copied from interface:BasicDetailsReturns true iff the given key is defined.- Specified by:
isin interfaceBasicDetails- Overrides:
isin classAbstractBasicDetails
-
get
public String get(String key)
Description copied from interface:BasicDetailsGets the value of the given key, or null if undefined.- Specified by:
getin interfaceBasicDetails- Overrides:
getin classAbstractBasicDetails
-
-