Package ontopoly.models
Class FieldValuesModel
- java.lang.Object
-
- org.apache.wicket.model.LoadableDetachableModel<List<FieldValueModel>>
-
- ontopoly.models.FieldValuesModel
-
- All Implemented Interfaces:
Serializable
,Comparator<FieldValueModel>
,org.apache.wicket.IClusterable
,org.apache.wicket.model.IDetachable
,org.apache.wicket.model.IModel<List<FieldValueModel>>
public class FieldValuesModel extends org.apache.wicket.model.LoadableDetachableModel<List<FieldValueModel>> implements Comparator<FieldValueModel>
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FieldValuesModel(FieldInstanceModel fieldInstanceModel)
FieldValuesModel(FieldInstanceModel fieldInstanceModel, Comparator<Object> comparator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(FieldValueModel fvm1, FieldValueModel fvm2)
boolean
containsExisting()
boolean
getAutoExtraField()
FieldInstanceModel
getFieldInstanceModel()
int
getNumberOfValues()
Get the number of actual existing values.List<FieldValueModel>
getObject()
boolean
getShowExtraField()
boolean
getShowExtraFieldUserTriggered()
protected Collection<? extends Object>
getValues(FieldInstance fieldInstance)
protected List<FieldValueModel>
load()
void
setAutoExtraField(boolean autoExtraField)
void
setShowExtraField(boolean showExtraField, boolean userTriggered)
int
size()
Returns the number of values in the model.-
Methods inherited from class org.apache.wicket.model.LoadableDetachableModel
detach, isAttached, onAttach, onDetach, setObject, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Constructor Detail
-
FieldValuesModel
public FieldValuesModel(FieldInstanceModel fieldInstanceModel)
-
FieldValuesModel
public FieldValuesModel(FieldInstanceModel fieldInstanceModel, Comparator<Object> comparator)
-
-
Method Detail
-
getAutoExtraField
public boolean getAutoExtraField()
-
setAutoExtraField
public void setAutoExtraField(boolean autoExtraField)
-
getFieldInstanceModel
public FieldInstanceModel getFieldInstanceModel()
-
getShowExtraField
public boolean getShowExtraField()
-
getShowExtraFieldUserTriggered
public boolean getShowExtraFieldUserTriggered()
-
setShowExtraField
public void setShowExtraField(boolean showExtraField, boolean userTriggered)
-
size
public int size()
Returns the number of values in the model. Note that the first one might not represent an actual value. Use getNumberOfValues() to get the real number of actual values in the model.- Returns:
- the size of the model.
-
getNumberOfValues
public int getNumberOfValues()
Get the number of actual existing values. Number is either the same as size() or one less if the showExtraField is enabled.- Returns:
- the number of actual values
-
containsExisting
public boolean containsExisting()
-
getValues
protected Collection<? extends Object> getValues(FieldInstance fieldInstance)
-
getObject
public List<FieldValueModel> getObject()
- Specified by:
getObject
in interfaceorg.apache.wicket.model.IModel<List<FieldValueModel>>
- Overrides:
getObject
in classorg.apache.wicket.model.LoadableDetachableModel<List<FieldValueModel>>
-
load
protected List<FieldValueModel> load()
- Specified by:
load
in classorg.apache.wicket.model.LoadableDetachableModel<List<FieldValueModel>>
-
compare
public int compare(FieldValueModel fvm1, FieldValueModel fvm2)
- Specified by:
compare
in interfaceComparator<FieldValueModel>
-
-