ontopoly.models
Class FieldValuesModel

java.lang.Object
  extended by org.apache.wicket.model.LoadableDetachableModel<java.util.List<FieldValueModel>>
      extended by ontopoly.models.FieldValuesModel
All Implemented Interfaces:
java.io.Serializable, java.util.Comparator<FieldValueModel>, org.apache.wicket.IClusterable, org.apache.wicket.model.IDetachable, org.apache.wicket.model.IModel<java.util.List<FieldValueModel>>

public class FieldValuesModel
extends org.apache.wicket.model.LoadableDetachableModel<java.util.List<FieldValueModel>>
implements java.util.Comparator<FieldValueModel>

See Also:
Serialized Form

Constructor Summary
FieldValuesModel(FieldInstanceModel fieldInstanceModel)
           
FieldValuesModel(FieldInstanceModel fieldInstanceModel, java.util.Comparator<java.lang.Object> comparator)
           
 
Method Summary
 int compare(FieldValueModel fvm1, FieldValueModel fvm2)
           
 boolean containsExisting()
           
 boolean getAutoExtraField()
           
 FieldInstanceModel getFieldInstanceModel()
           
 int getNumberOfValues()
          Get the number of actual existing values.
 java.util.List<FieldValueModel> getObject()
           
 boolean getShowExtraField()
           
 boolean getShowExtraFieldUserTriggered()
           
protected  java.util.Collection<? extends java.lang.Object> getValues(FieldInstance fieldInstance)
           
protected  java.util.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
 

Constructor Detail

FieldValuesModel

public FieldValuesModel(FieldInstanceModel fieldInstanceModel)

FieldValuesModel

public FieldValuesModel(FieldInstanceModel fieldInstanceModel,
                        java.util.Comparator<java.lang.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 java.util.Collection<? extends java.lang.Object> getValues(FieldInstance fieldInstance)

getObject

public java.util.List<FieldValueModel> getObject()
Specified by:
getObject in interface org.apache.wicket.model.IModel<java.util.List<FieldValueModel>>
Overrides:
getObject in class org.apache.wicket.model.LoadableDetachableModel<java.util.List<FieldValueModel>>

load

protected java.util.List<FieldValueModel> load()
Specified by:
load in class org.apache.wicket.model.LoadableDetachableModel<java.util.List<FieldValueModel>>

compare

public int compare(FieldValueModel fvm1,
                   FieldValueModel fvm2)
Specified by:
compare in interface java.util.Comparator<FieldValueModel>


Copyright © 2000-2012 Ontopia.