public interface ModuleItem<T> extends BasicDetails
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.
|
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).
|
Class<T> |
getType()
Gets the type of the item.
|
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.
|
void |
validate(Module module)
Invokes this item's validation function, if any, on the given module.
|
get, getDescription, getLabel, is, set, setDescription, setLabel
ModuleInfo getInfo()
ModuleInfo
to which this item belongs.Type getGenericType()
For many modules, this may be the same Class
object returned by
getType()
, but some module inputs or outputs may be backed by a
generic type such as List<String>
or Iterable<Integer>
.
Field.getGenericType()
ItemIO getIOType()
boolean isInput()
boolean isOutput()
ItemVisibility getVisibility()
boolean isAutoFill()
boolean isRequired()
boolean isPersisted()
String getPersistKey()
@Deprecated T loadValue()
saveValue(Object)
.
Note that this is different than obtaining a module instance's current
value for the input; see getValue(Module)
for that.
ModuleService.load(ModuleItem)
@Deprecated void saveValue(T value)
loadValue()
, even from a different JVM.ModuleService.save(ModuleItem, Object)
String getInitializer()
void initialize(Module module) throws MethodCallException
MethodCallException
getInitializer()
String getValidater()
void validate(Module module) throws MethodCallException
MethodCallException
getValidater()
String getCallback()
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.
void callback(Module module) throws MethodCallException
MethodCallException
getCallback()
String getWidgetStyle()
T getDefaultValue()
T getMinimumValue()
T getMaximumValue()
T getSoftMinimum()
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.
T getSoftMaximum()
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.
Number getStepSize()
int getColumnCount()
Copyright © 2015–2022 SciJava. All rights reserved.