org.scijava.widget
Class AbstractInputWidget<T,W>

java.lang.Object
  extended by org.scijava.AbstractContextual
      extended by org.scijava.plugin.AbstractRichPlugin
          extended by org.scijava.plugin.AbstractTypedPlugin<D>
              extended by org.scijava.plugin.AbstractWrapperPlugin<WidgetModel>
                  extended by org.scijava.widget.AbstractInputWidget<T,W>
Type Parameters:
T - The input type of the widget.
W - The type of UI component housing the widget.
All Implemented Interfaces:
Comparable<Prioritized>, Contextual, HasPluginInfo, RichPlugin, SciJavaPlugin, TypedPlugin<WidgetModel>, WrapperPlugin<WidgetModel>, Prioritized, Typed<WidgetModel>, InputWidget<T,W>, UIComponent<W>
Direct Known Subclasses:
AbstractUIInputWidget

public abstract class AbstractInputWidget<T,W>
extends AbstractWrapperPlugin<WidgetModel>
implements InputWidget<T,W>

Base class for input widgets.

Author:
Curtis Rueden

Constructor Summary
AbstractInputWidget()
           
 
Method Summary
 WidgetModel get()
          Gets the data object currently associated with this plugin.
 Class<WidgetModel> getType()
          Gets the type associated with the object.
 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 set(WidgetModel model)
          Associates the given data object with this plugin.
 boolean supports(WidgetModel model)
          Gets whether this object is compatible with the given data object.
 void updateModel()
          Updates the model to reflect the latest widget state.
 
Methods inherited from class org.scijava.plugin.AbstractRichPlugin
compareTo, getInfo, getPriority, setInfo, setPriority, toString
 
Methods inherited from class org.scijava.AbstractContextual
context, getContext, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.scijava.widget.InputWidget
getValue, refreshWidget
 
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
 
Methods inherited from interface org.scijava.Prioritized
getPriority, setPriority
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
 
Methods inherited from interface org.scijava.widget.UIComponent
getComponent, getComponentType
 

Constructor Detail

AbstractInputWidget

public AbstractInputWidget()
Method Detail

updateModel

public void updateModel()
Description copied from interface: InputWidget
Updates the model to reflect the latest widget state.

Specified by:
updateModel in interface InputWidget<T,W>

isLabeled

public boolean isLabeled()
Description copied from interface: InputWidget
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.

Specified by:
isLabeled in interface InputWidget<T,W>
See Also:
WidgetModel.getWidgetLabel()

isMessage

public boolean isMessage()
Description copied from interface: InputWidget
Returns true iff the widget should be considered a read-only "message" rather than a bidirectional input widget. The InputPanel.isMessageOnly() method will return true iff this method returns true for all of its widgets.

Specified by:
isMessage in interface InputWidget<T,W>

set

public void set(WidgetModel model)
Description copied from interface: WrapperPlugin
Associates the given data object with this plugin. It must be a compatible object (i.e., Typed.supports(T) must return true).

Specified by:
set in interface WrapperPlugin<WidgetModel>
Specified by:
set in interface InputWidget<T,W>
Overrides:
set in class AbstractWrapperPlugin<WidgetModel>
Parameters:
model - The data object to associate with the plugin.

get

public WidgetModel get()
Description copied from interface: WrapperPlugin
Gets the data object currently associated with this plugin.

Specified by:
get in interface WrapperPlugin<WidgetModel>
Specified by:
get in interface InputWidget<T,W>
Overrides:
get in class AbstractWrapperPlugin<WidgetModel>

supports

public boolean supports(WidgetModel model)
Description copied from interface: Typed
Gets whether this object is compatible with the given data object.

By default, this method will return true always, since the type is known to be compatible. But individual implementations may have other requirements beyond class assignability.

Specified by:
supports in interface Typed<WidgetModel>
Specified by:
supports in interface InputWidget<T,W>
Overrides:
supports in class AbstractTypedPlugin<WidgetModel>

getType

public Class<WidgetModel> getType()
Description copied from interface: Typed
Gets the type associated with the object.

Specified by:
getType in interface Typed<WidgetModel>


Copyright © 2009–2015 SciJava. All rights reserved.