Package org.scijava.widget
Interface InputWidget<T,W>
-
- Type Parameters:
T- The input type of the widget.W- The type of UI component housing the widget.
- All Superinterfaces:
Comparable<Prioritized>,Contextual,HasPluginInfo,Identifiable,Locatable,Logged,Prioritized,RichPlugin,SciJavaPlugin,Typed<WidgetModel>,TypedPlugin<WidgetModel>,UIComponent<W>,Versioned,WrapperPlugin<WidgetModel>
- All Known Subinterfaces:
ButtonWidget<U>,ChoiceWidget<U>,ColorWidget<U>,DateWidget<U>,FileListWidget<U>,FileWidget<U>,MessageWidget<U>,NumberWidget<U>,ObjectWidget<U>,TextWidget<U>,ToggleWidget<U>
- All Known Implementing Classes:
AbstractInputWidget,AbstractUIInputWidget
public interface InputWidget<T,W> extends WrapperPlugin<WidgetModel>, UIComponent<W>
Interface for input widgets. An input widget is intended to harvest user input for a particularModuleItem. They are used by theInputHarvesterpreprocessor to collect module input values.Widgets discoverable at runtime must implement this interface and be annotated with @
Pluginwith attributePlugin.type()=InputWidget.class. While it possible to create a widget merely by implementing this interface, it is encouraged to instead extendAbstractInputWidget, for convenience.- Author:
- Curtis Rueden
- See Also:
Plugin,WidgetService,InputHarvester,InputPanel
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description WidgetModelget()Gets the model object backing this widget.default Class<WidgetModel>getType()Gets the type associated with the object.TgetValue()Gets the current widget value.default booleanisLabeled()Returns true iff the widget should be labeled with the parameter label.default booleanisMessage()Returns true iff the widget should be considered a read-only "message" rather than a bidirectional input widget.voidrefreshWidget()Refreshes the widget to reflect the latest model value(s).voidset(WidgetModel model)Initializes the widget to use the given widget model.default booleansupports(WidgetModel model)Gets whether this widget would be appropriate for the given model.voidupdateModel()Updates the model to reflect the latest widget state.-
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
-
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
-
Methods inherited from interface org.scijava.Locatable
getLocation
-
Methods inherited from interface org.scijava.Prioritized
compareTo, getPriority, setPriority
-
Methods inherited from interface org.scijava.plugin.RichPlugin
getIdentifier, log
-
Methods inherited from interface org.scijava.widget.UIComponent
getComponent, getComponentType
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
-
-
-
Method Detail
-
updateModel
void updateModel()
Updates the model to reflect the latest widget state.
-
getValue
T getValue()
Gets the current widget value.
-
refreshWidget
void refreshWidget()
Refreshes the widget to reflect the latest model value(s).
-
isLabeled
default boolean isLabeled()
Returns true iff the widget should be labeled with the parameter label. Most widgets are labeled this way, though some may not be; e.g.,MessageWidgets.- See Also:
WidgetModel.getWidgetLabel()
-
isMessage
default boolean isMessage()
Returns true iff the widget should be considered a read-only "message" rather than a bidirectional input widget. TheInputPanel.isMessageOnly()method will return true iff this method returns true for all of its widgets.
-
set
void set(WidgetModel model)
Initializes the widget to use the given widget model. Once initialized, the widget's UI pane will be accessible viaUIComponent.getComponent().- Specified by:
setin interfaceWrapperPlugin<T>- Parameters:
model- The data object to associate with the plugin.
-
get
WidgetModel get()
Gets the model object backing this widget.- Specified by:
getin interfaceWrapperPlugin<T>
-
supports
default boolean supports(WidgetModel model)
Gets whether this widget would be appropriate for the given model.
-
-