org.scijava.plugin
Annotation Type Parameter


@Retention(value=RUNTIME)
@Target(value=FIELD)
public @interface Parameter

An annotation for indicating a field is an input or output parameter. This annotation is a useful way for plugins to declare their inputs and outputs simply.

Author:
Johannes Schindelin, Grant Harris, Curtis Rueden

Optional Element Summary
 Attr[] attrs
          A list of additional attributes which can be used to extend this annotation beyond its built-in capabilities.
 boolean autoFill
          Defines whether the parameter value should be filled programmatically, if possible.
 String callback
          Defines a function that is called whenever this parameter changes.
 String[] choices
          Defines the list of possible values (multiple choice text fields only).
 int columns
          Defines the width of the input field in characters (text field parameters only).
 String description
          Defines a description for the parameter.
 String initializer
          Defines a function that is called to initialize the parameter.
 String label
          Defines a label for the parameter.
 String max
          Defines the maximum allowed value (numeric parameters only).
 String min
          Defines the minimum allowed value (numeric parameters only).
 boolean persist
          Defines whether to remember the most recent value of the parameter.
 String persistKey
          Defines a key to use for saving the value persistently.
 boolean required
          Defines whether the parameter value must be non-null.
 String stepSize
          Defines the step size to use (numeric parameters only).
 String style
          Defines the preferred widget style.
 ItemIO type
          Defines the input/output type of the parameter.
 ItemVisibility visibility
          Defines the "visibility" of the parameter.
 

label

public abstract String label
Defines a label for the parameter.

Default:
""

description

public abstract String description
Defines a description for the parameter.

Default:
""

type

public abstract ItemIO type
Defines the input/output type of the parameter.

Choices are:

Default:
org.scijava.ItemIO.INPUT

visibility

public abstract ItemVisibility visibility
Defines the "visibility" of the parameter.

Choices are:

Default:
org.scijava.ItemVisibility.NORMAL

autoFill

public abstract boolean autoFill
Defines whether the parameter value should be filled programmatically, if possible.

Default:
true

required

public abstract boolean required
Defines whether the parameter value must be non-null.

Default:
true

persist

public abstract boolean persist
Defines whether to remember the most recent value of the parameter.

Default:
true

persistKey

public abstract String persistKey
Defines a key to use for saving the value persistently.

Default:
""

initializer

public abstract String initializer
Defines a function that is called to initialize the parameter.

Default:
""

callback

public abstract String callback
Defines a function that is called whenever this parameter changes.

This mechanism enables interdependent parameters of various types. For example, two int parameters "width" and "height" could update each other when another boolean "Preserve aspect ratio" flag is set.

Default:
""

style

public abstract String style
Defines the preferred widget style.

We do not use an enum because the styles need to be extensible. And we cannot use an interface-driven extensible enum pattern, because interfaces cannot be used as attributes within a Java annotation interface. So we fall back to strings!

Default:
""

min

public abstract String min
Defines the minimum allowed value (numeric parameters only).

Default:
""

max

public abstract String max
Defines the maximum allowed value (numeric parameters only).

Default:
""

stepSize

public abstract String stepSize
Defines the step size to use (numeric parameters only).

Default:
""

columns

public abstract int columns
Defines the width of the input field in characters (text field parameters only).

Default:
6

choices

public abstract String[] choices
Defines the list of possible values (multiple choice text fields only).

Default:
{}

attrs

public abstract Attr[] attrs
A list of additional attributes which can be used to extend this annotation beyond its built-in capabilities.

Default:
{}


Copyright © 2009–2015 SciJava. All rights reserved.