DatatypeWidget¶
-
public abstract class
DatatypeWidget
<T extends EhrDatatype> implements EhrDatatypeChangeListener<T>¶ This the base class for all DatatypeWidgets. A
DatatypeWidget
is a visual and interactive widget mapped on a specificEhrDatatype
. A user can instantiate aDatatypeWidget
for reading, editing and saving the content of theEhrDatatype
handled by it.Parameters: - <T> – the generic
EhrDatatype
- <T> – the generic
Fields¶
_widget_provider¶
-
protected WidgetProvider
_widget_provider
¶
Constructors¶
DatatypeWidget¶
-
public
DatatypeWidget
(WidgetProvider provider, String name, T datatype, int parent_index)¶ Instantiates a new
DatatypeWidget
widget.Parameters: - context – the context
- name – the name of this widget
- datatype – the
EhrDatatype
to be handled by this widget - ontology – the ontology used
- parent_index – the parent_index
Methods¶
getDatatype¶
-
public T
getDatatype
()¶ Gets the
EhrDatatype
handled by this widgetReturns: the EhrDatatype
getPriority¶
-
public int
getPriority
()¶ returns the visual priority of this widget (essentially this means it’s physical location in the form).
Returns: the priority
getView¶
-
public View
getView
()¶ get the Root View containing this widget’s view elements.
Returns: the view
getWidgetProvider¶
-
public WidgetProvider
getWidgetProvider
()¶
replaceTooltip¶
-
protected abstract void
replaceTooltip
(ToolTip tooltip)¶ Replace tooltip.
Parameters: - tooltip – the tooltip
reset¶
-
public abstract void
reset
()¶ Reset all fields of this widget according to the current underlying datatype value.
save¶
-
public abstract void
save
()¶ Update the value of the underlying datatype according to the current value of the fields of this widget.
Throws: - InvalidDatatypeException – if the current value of the fields cannot be converted to a datatype value
setOntology¶
setPriority¶
-
public void
setPriority
(int value)¶ sets the visual priority of this widget essentially this means it’s physical location in the form.
Parameters: - value – the new priority