org.scijava.command
Class CommandModuleItem<T>

java.lang.Object
  extended by org.scijava.AbstractBasicDetails
      extended by org.scijava.module.AbstractModuleItem<T>
          extended by org.scijava.command.CommandModuleItem<T>
All Implemented Interfaces:
BasicDetails, ModuleItem<T>

public class CommandModuleItem<T>
extends AbstractModuleItem<T>

ModuleItem implementation describing an input or output of a command.

Author:
Curtis Rueden

Constructor Summary
CommandModuleItem(ModuleInfo info, Field field)
           
 
Method Summary
 String get(String key)
          Gets the value of the given key, or null if undefined.
 String getCallback()
          Gets the function that is called whenever this item changes.
 List<T> getChoices()
          Gets the list of possible values.
 int getColumnCount()
          Gets the preferred width of the input field in characters (if applicable).
 String getDescription()
          Gets a string describing the object.
 Field getField()
           
 Type getGenericType()
          Gets the type of the item, including Java generic parameters.
 String getInitializer()
          Gets the function that is called to initialize the item's value.
 ItemIO getIOType()
          Gets the input/output type of the item.
 String getLabel()
          Gets the name to appear in a UI, if applicable.
 T getMaximumValue()
          Gets the maximum allowed value (if applicable).
 T getMinimumValue()
          Gets the minimum allowed value (if applicable).
 String getName()
          Gets the unique name of the object.
 Parameter getParameter()
           
 String getPersistKey()
          Gets the key to use for saving the value persistently.
 Number getStepSize()
          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.
 ItemVisibility getVisibility()
          Gets the visibility of the item.
 String getWidgetStyle()
          Gets the preferred widget style to use when rendering the item in a user interface.
 boolean is(String key)
          Returns true iff the given key is defined.
 boolean isAutoFill()
          Gets whether the item value is allowed to be auto-filled.
 boolean isPersisted()
          Gets whether to remember the most recent value of the parameter.
 boolean isRequired()
          Gets whether the item value must be specified (i.e., no default).
 
Methods inherited from class org.scijava.module.AbstractModuleItem
callback, getDelegateClass, getSoftMaximum, getSoftMinimum, getValue, initialize, isInput, isOutput, loadValue, saveValue, setValue, toString
 
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, setName
 

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: ModuleItem
Gets the type of the item.


getGenericType

public Type getGenericType()
Description copied from interface: ModuleItem
Gets the type of the item, including Java generic parameters.

For many modules, this may be the same Class object returned by ModuleItem.getType(), but some module inputs or outputs may be backed by a generic type such as List<String> or Iterable<Integer>.

Specified by:
getGenericType in interface ModuleItem<T>
Overrides:
getGenericType in class AbstractModuleItem<T>
See Also:
Field.getGenericType()

getIOType

public ItemIO getIOType()
Description copied from interface: ModuleItem
Gets the input/output type of the item.

Specified by:
getIOType in interface ModuleItem<T>
Overrides:
getIOType in class AbstractModuleItem<T>

getVisibility

public ItemVisibility getVisibility()
Description copied from interface: ModuleItem
Gets the visibility of the item.

Specified by:
getVisibility in interface ModuleItem<T>
Overrides:
getVisibility in class AbstractModuleItem<T>

isAutoFill

public boolean isAutoFill()
Description copied from interface: ModuleItem
Gets whether the item value is allowed to be auto-filled.

Specified by:
isAutoFill in interface ModuleItem<T>
Overrides:
isAutoFill in class AbstractModuleItem<T>

isRequired

public boolean isRequired()
Description copied from interface: ModuleItem
Gets whether the item value must be specified (i.e., no default).

Specified by:
isRequired in interface ModuleItem<T>
Overrides:
isRequired in class AbstractModuleItem<T>

isPersisted

public boolean isPersisted()
Description copied from interface: ModuleItem
Gets whether to remember the most recent value of the parameter.

Specified by:
isPersisted in interface ModuleItem<T>
Overrides:
isPersisted in class AbstractModuleItem<T>

getPersistKey

public String getPersistKey()
Description copied from interface: ModuleItem
Gets the key to use for saving the value persistently.

Specified by:
getPersistKey in interface ModuleItem<T>
Overrides:
getPersistKey in class AbstractModuleItem<T>

getInitializer

public String getInitializer()
Description copied from interface: ModuleItem
Gets the function that is called to initialize the item's value.

Specified by:
getInitializer in interface ModuleItem<T>
Overrides:
getInitializer in class AbstractModuleItem<T>

getCallback

public String getCallback()
Description copied from interface: ModuleItem
Gets 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:
getCallback in interface ModuleItem<T>
Overrides:
getCallback in class AbstractModuleItem<T>

getWidgetStyle

public String getWidgetStyle()
Description copied from interface: ModuleItem
Gets the preferred widget style to use when rendering the item in a user interface.

Specified by:
getWidgetStyle in interface ModuleItem<T>
Overrides:
getWidgetStyle in class AbstractModuleItem<T>

getMinimumValue

public T getMinimumValue()
Description copied from interface: ModuleItem
Gets the minimum allowed value (if applicable).

Specified by:
getMinimumValue in interface ModuleItem<T>
Overrides:
getMinimumValue in class AbstractModuleItem<T>

getMaximumValue

public T getMaximumValue()
Description copied from interface: ModuleItem
Gets the maximum allowed value (if applicable).

Specified by:
getMaximumValue in interface ModuleItem<T>
Overrides:
getMaximumValue in class AbstractModuleItem<T>

getStepSize

public Number getStepSize()
Description copied from interface: ModuleItem
Gets the preferred step size to use when rendering the item in a user interface (if applicable).

Specified by:
getStepSize in interface ModuleItem<T>
Overrides:
getStepSize in class AbstractModuleItem<T>

getColumnCount

public int getColumnCount()
Description copied from interface: ModuleItem
Gets the preferred width of the input field in characters (if applicable).

Specified by:
getColumnCount in interface ModuleItem<T>
Overrides:
getColumnCount in class AbstractModuleItem<T>

getChoices

public List<T> getChoices()
Description copied from interface: ModuleItem
Gets the list of possible values.

Specified by:
getChoices in interface ModuleItem<T>
Overrides:
getChoices in class AbstractModuleItem<T>

getName

public String getName()
Description copied from interface: BasicDetails
Gets the unique name of the object.

Specified by:
getName in interface BasicDetails
Overrides:
getName in class AbstractBasicDetails

getLabel

public String getLabel()
Description copied from interface: BasicDetails
Gets the name to appear in a UI, if applicable.

Specified by:
getLabel in interface BasicDetails
Overrides:
getLabel in class AbstractBasicDetails

getDescription

public String getDescription()
Description copied from interface: BasicDetails
Gets a string describing the object.

Specified by:
getDescription in interface BasicDetails
Overrides:
getDescription in class AbstractBasicDetails

is

public boolean is(String key)
Description copied from interface: BasicDetails
Returns true iff the given key is defined.

Specified by:
is in interface BasicDetails
Overrides:
is in class AbstractBasicDetails

get

public String get(String key)
Description copied from interface: BasicDetails
Gets the value of the given key, or null if undefined.

Specified by:
get in interface BasicDetails
Overrides:
get in class AbstractBasicDetails


Copyright © 2009–2014 SciJava. All rights reserved.