Package org.scijava.widget
Class AbstractInputPanel<P,W>
- java.lang.Object
-
- org.scijava.widget.AbstractInputPanel<P,W>
-
- Type Parameters:
P- The type of UI component housing the input panel itself.W- The type of UI component housing each input widget.
- All Implemented Interfaces:
InputPanel<P,W>,UIComponent<P>
public abstract class AbstractInputPanel<P,W> extends Object implements InputPanel<P,W>
Abstract superclass of UI-specificInputPanelimplementations.- Author:
- Curtis Rueden
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,InputWidget<?,W>>widgetsTable of widgets.
-
Constructor Summary
Constructors Constructor Description AbstractInputPanel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddWidget(InputWidget<?,W> widget)Adds a widget to the panel.ObjectgetValue(String name)Returns the value of the given widget's input.InputWidget<?,W>getWidget(String name)Gets the widget with the provided name.intgetWidgetCount()Gets the number of active widgets in the input panel.booleanhasWidgets()Gets whether the input panel has any active widgets.booleanisMessageOnly()Returns true if the input panel consists of only messages.voidrefresh()Updates the widgets to reflect the most recent parameter value(s).-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.scijava.widget.InputPanel
getWidgetComponentType, supports
-
Methods inherited from interface org.scijava.widget.UIComponent
getComponent, getComponentType
-
-
-
-
Field Detail
-
widgets
protected Map<String,InputWidget<?,W>> widgets
Table of widgets.
-
-
Method Detail
-
addWidget
public void addWidget(InputWidget<?,W> widget)
Description copied from interface:InputPanelAdds a widget to the panel.- Specified by:
addWidgetin interfaceInputPanel<P,W>
-
getWidget
public InputWidget<?,W> getWidget(String name)
Description copied from interface:InputPanelGets the widget with the provided name.- Specified by:
getWidgetin interfaceInputPanel<P,W>
-
getValue
public Object getValue(String name)
Description copied from interface:InputPanelReturns the value of the given widget's input.- Specified by:
getValuein interfaceInputPanel<P,W>- Parameters:
name- unique name identifying this field
-
getWidgetCount
public int getWidgetCount()
Description copied from interface:InputPanelGets the number of active widgets in the input panel.- Specified by:
getWidgetCountin interfaceInputPanel<P,W>
-
hasWidgets
public boolean hasWidgets()
Description copied from interface:InputPanelGets whether the input panel has any active widgets.- Specified by:
hasWidgetsin interfaceInputPanel<P,W>
-
isMessageOnly
public boolean isMessageOnly()
Description copied from interface:InputPanelReturns true if the input panel consists of only messages.- Specified by:
isMessageOnlyin interfaceInputPanel<P,W>
-
refresh
public void refresh()
Description copied from interface:InputPanelUpdates the widgets to reflect the most recent parameter value(s).- Specified by:
refreshin interfaceInputPanel<P,W>
-
-