|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnextapp.echo.app.list.AbstractListModel
com.sptci.echo.list.EnumListModel<E>
E - The enum class that backs this list model.public class EnumListModel<E extends Enum>
A list model based on an enum. Uses the oridinal index in the enum as the basis of the list values.
import com.sptci.echo.list.FilteredEnumListModel;
import com.sptci.echo.list.SelectField;
...
// Type is an enum
final EnumListModel<Type> model = new EnumListModel<Type>( Type.class );
final SelectField<EnumListModel<Type>> select = new SelectField<EnumListModel<Type>>();
select.setModel( model );
© Copyright 2009 Sans Pareil Technologies, Inc.
| Field Summary | |
|---|---|
protected Class<E> |
enumClass
The enum class that is used as the backing data model. |
| Constructor Summary | |
|---|---|
EnumListModel(Class<E> cls)
Create a new instance using the specified enum class. |
|
| Method Summary | |
|---|---|
E |
get(int index)
Returns the enumerated contant value at the specified index. |
int |
size()
Return the total number of contants in the enumeration. |
| Methods inherited from class nextapp.echo.app.list.AbstractListModel |
|---|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getEventListenerList, removeListDataListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Class<E extends Enum> enumClass
| Constructor Detail |
|---|
public EnumListModel(Class<E> cls)
cls - The enum class to use.| Method Detail |
|---|
public E get(int index)
index - The index for the constant value.
ListModel.get(int)public int size()
ListModel.size()
|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||