T
- The input type of the widget.W
- The type of UI component housing the widget.public interface InputWidget<T,W> extends WrapperPlugin<WidgetModel>, UIComponent<W>
ModuleItem
. They are used by the
InputHarvester
preprocessor to collect module input values.
Widgets discoverable at runtime must implement this interface and be
annotated with @Plugin
with attribute Plugin.type()
=
InputWidget
.class. While it possible to create a widget merely by
implementing this interface, it is encouraged to instead extend
AbstractInputWidget
, for convenience.
Plugin
,
WidgetService
,
InputHarvester
,
InputPanel
Modifier and Type | Method and Description |
---|---|
WidgetModel |
get()
Gets the model object backing this widget.
|
T |
getValue()
Gets the current widget value.
|
boolean |
isLabeled()
Returns true iff the widget should be labeled with the parameter label.
|
boolean |
isMessage()
Returns true iff the widget should be considered a read-only "message"
rather than a bidirectional input widget.
|
void |
refreshWidget()
Refreshes the widget to reflect the latest model value(s).
|
void |
set(WidgetModel model)
Initializes the widget to use the given widget model.
|
boolean |
supports(WidgetModel model)
Gets whether this widget would be appropriate for the given model.
|
void |
updateModel()
Updates the model to reflect the latest widget state.
|
context, getContext, setContext
getPriority, setPriority
compareTo
getInfo, setInfo
getComponent, getComponentType
void updateModel()
T getValue()
void refreshWidget()
boolean isLabeled()
MessageWidget
s.WidgetModel.getWidgetLabel()
boolean isMessage()
InputPanel.isMessageOnly()
method will return true iff this method
returns true for all of its widgets.void set(WidgetModel model)
UIComponent.getComponent()
.set
in interface WrapperPlugin<WidgetModel>
model
- The data object to associate with the plugin.WidgetModel get()
get
in interface WrapperPlugin<WidgetModel>
boolean supports(WidgetModel model)
supports
in interface Typed<WidgetModel>
Copyright © 2009–2015 SciJava. All rights reserved.