Package io.guise.framework.model
Class DefaultListSelectEditor<V>
- java.lang.Object
-
- io.guise.framework.model.AbstractListSelectEditor<V>
-
- io.guise.framework.model.DefaultListSelectEditor<V>
-
- Type Parameters:
V
- The type of values contained in the model.
- All Implemented Interfaces:
ListSelectEditor<V>
public class DefaultListSelectEditor<V> extends AbstractListSelectEditor<V>
The default implementation for editing values in a list model. Prototypes are provided for common edit functionality. This class registers itself with the given list, which will cause memory leaks if an instance of this class is discarded without also discarding the list. The editing component class and the list select model's value class must each have a public default constructor.- Author:
- Garret Wilson
-
-
Constructor Summary
Constructors Constructor Description DefaultListSelectEditor(ListSelectModel<V> listSelectModel, java.lang.Class<? extends ValuedComponent<V>> valuedComponentClass)
List select model and valued component constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected V
createValue()
Creates a new value to add to the list.protected ValuedComponent<V>
createValuedComponent()
Creates a component for editing a value.java.lang.Class<? extends ValuedComponent<V>>
getValuedComponentClass()
-
Methods inherited from class io.guise.framework.model.AbstractListSelectEditor
editValue, editValue, getEditActionPrototype, getInsertActionPrototype, getListSelectModel, getLowerActionPrototype, getRaiseActionPrototype, getRemoveActionPrototype, insertValue, lowerValue, raiseValue, removeValue, updateProperties
-
-
-
-
Constructor Detail
-
DefaultListSelectEditor
public DefaultListSelectEditor(ListSelectModel<V> listSelectModel, java.lang.Class<? extends ValuedComponent<V>> valuedComponentClass)
List select model and valued component constructor.- Parameters:
listSelectModel
- The list select model this prototype manipulates.valuedComponentClass
- The class for the component allowing a list value to be edited.- Throws:
java.lang.NullPointerException
- if the given list select model and/or value component class isnull
.
-
-
Method Detail
-
getValuedComponentClass
public java.lang.Class<? extends ValuedComponent<V>> getValuedComponentClass()
- Returns:
- The class for the component allowing a list value to be edited.
-
createValue
protected V createValue()
Creates a new value to add to the list.This implementation instantiates a default instance of the list select model's value class.
- Specified by:
createValue
in classAbstractListSelectEditor<V>
- Returns:
- A new default value to add.
- See Also:
ValueModel.getValueClass()
-
createValuedComponent
protected ValuedComponent<V> createValuedComponent()
Creates a component for editing a value.This version creates a new valued component from the valued component class.
- Specified by:
createValuedComponent
in classAbstractListSelectEditor<V>
- Returns:
- A component for editing the value.
- See Also:
getValuedComponentClass()
-
-