public abstract class AbstractModuleItem<T> extends AbstractBasicDetails implements ModuleItem<T>
ModuleItem
implementations.Constructor and Description |
---|
AbstractModuleItem(ModuleInfo info) |
Modifier and Type | Method and Description |
---|---|
void |
callback(Module module)
Invokes this item's callback function, if any, on the given module.
|
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).
|
T |
getDefaultValue()
Gets the default value.
|
protected Class<?> |
getDelegateClass() |
Type |
getGenericType()
Gets the type of the item, including Java generic parameters.
|
ModuleInfo |
getInfo()
Gets the
ModuleInfo to which this item belongs. |
String |
getInitializer()
Gets the function that is called to initialize the item's value.
|
ItemIO |
getIOType()
Gets the input/output type of the item.
|
T |
getMaximumValue()
Gets the maximum allowed value (if applicable).
|
T |
getMinimumValue()
Gets the minimum allowed value (if applicable).
|
String |
getPersistKey()
Gets the key to use for saving the value persistently.
|
T |
getSoftMaximum()
Gets the "soft" maximum value (if applicable).
|
T |
getSoftMinimum()
Gets the "soft" minimum value (if applicable).
|
Number |
getStepSize()
Gets the preferred step size to use when rendering the item in a user
interface (if applicable).
|
String |
getValidater()
Gets the function that is called to validate the item's value.
|
T |
getValue(Module module)
Gets the item's current value with respect to the given module.
|
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.
|
void |
initialize(Module module)
Invokes this item's initializer function, if any, on the given module.
|
boolean |
isAutoFill()
Gets whether the item value is allowed to be auto-filled.
|
boolean |
isInput()
Gets whether the item is a module input.
|
boolean |
isOutput()
Gets whether the item is a module output.
|
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).
|
T |
loadValue()
Deprecated.
|
void |
saveValue(T value)
Deprecated.
|
void |
setValue(Module module,
T value)
Sets the item's current value with respect to the given module.
|
String |
toString() |
void |
validate(Module module)
Invokes this item's validation function, if any, on the given module.
|
get, getDescription, getLabel, getName, is, set, setDescription, setLabel, setName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getType
get, getDescription, getLabel, is, set, setDescription, setLabel
public AbstractModuleItem(ModuleInfo info)
public String toString()
toString
in class AbstractBasicDetails
public ModuleInfo getInfo()
ModuleItem
ModuleInfo
to which this item belongs.getInfo
in interface ModuleItem<T>
public Type getGenericType()
ModuleItem
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>
.
getGenericType
in interface ModuleItem<T>
Field.getGenericType()
public ItemIO getIOType()
ModuleItem
getIOType
in interface ModuleItem<T>
public boolean isInput()
ModuleItem
isInput
in interface ModuleItem<T>
public boolean isOutput()
ModuleItem
isOutput
in interface ModuleItem<T>
public ItemVisibility getVisibility()
ModuleItem
getVisibility
in interface ModuleItem<T>
public boolean isAutoFill()
ModuleItem
isAutoFill
in interface ModuleItem<T>
public boolean isRequired()
ModuleItem
isRequired
in interface ModuleItem<T>
public boolean isPersisted()
ModuleItem
isPersisted
in interface ModuleItem<T>
public String getPersistKey()
ModuleItem
getPersistKey
in interface ModuleItem<T>
@Deprecated public T loadValue()
loadValue
in interface ModuleItem<T>
ModuleService.load(ModuleItem)
@Deprecated public void saveValue(T value)
ModuleItem
ModuleItem.loadValue()
, even from a different JVM.saveValue
in interface ModuleItem<T>
ModuleService.save(ModuleItem, Object)
public String getInitializer()
ModuleItem
getInitializer
in interface ModuleItem<T>
public void initialize(Module module) throws MethodCallException
ModuleItem
initialize
in interface ModuleItem<T>
MethodCallException
ModuleItem.getInitializer()
public String getValidater()
ModuleItem
getValidater
in interface ModuleItem<T>
public void validate(Module module) throws MethodCallException
ModuleItem
validate
in interface ModuleItem<T>
MethodCallException
ModuleItem.getValidater()
public String getCallback()
ModuleItem
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.
getCallback
in interface ModuleItem<T>
public void callback(Module module) throws MethodCallException
ModuleItem
callback
in interface ModuleItem<T>
MethodCallException
ModuleItem.getCallback()
public String getWidgetStyle()
ModuleItem
getWidgetStyle
in interface ModuleItem<T>
public T getDefaultValue()
ModuleItem
getDefaultValue
in interface ModuleItem<T>
public T getMinimumValue()
ModuleItem
getMinimumValue
in interface ModuleItem<T>
public T getMaximumValue()
ModuleItem
getMaximumValue
in interface ModuleItem<T>
public T getSoftMinimum()
ModuleItem
The soft minimum is a hint for use in bounded scenarios, such as rendering in a user interface with a slider or scroll bar widget; the parameter value will not actually be clamped to the soft bounds, but they may be used in certain circumstances where appropriate.
getSoftMinimum
in interface ModuleItem<T>
public T getSoftMaximum()
ModuleItem
The soft maximum is a hint for use in bounded scenarios, such as rendering in a user interface with a slider or scroll bar widget; the parameter value will not actually be clamped to the soft bounds, but they may be used in certain circumstances where appropriate.
getSoftMaximum
in interface ModuleItem<T>
public Number getStepSize()
ModuleItem
getStepSize
in interface ModuleItem<T>
public int getColumnCount()
ModuleItem
getColumnCount
in interface ModuleItem<T>
public List<T> getChoices()
ModuleItem
getChoices
in interface ModuleItem<T>
public T getValue(Module module)
ModuleItem
getValue
in interface ModuleItem<T>
public void setValue(Module module, T value)
ModuleItem
setValue
in interface ModuleItem<T>
protected Class<?> getDelegateClass()
Copyright © 2015–2022 SciJava. All rights reserved.