|
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>
com.sptci.echo.list.FilteredEnumListModel<E>
E - The enum class that backs this list model.public class FilteredEnumListModel<E extends Enum>
A list model that allows filtering out specified entries from the backing enum.
import com.sptci.echo.list.FilteredEnumListModel;
import com.sptci.echo.list.SelectField;
...
// Type is an enum with an instance Company.
final FilteredEnumListModel<Type> model = new FilteredEnumListModel<Type>( Type.class );
model.setFilter( Type.Company );
final SelectField<FilteredEnumListModel<Type>> select = new SelectField<FilteredEnumListModel<Type>>();
select.setModel( model );
© Copyright 2009 Sans Pareil Technologies, Inc.
| Field Summary |
|---|
| Fields inherited from class com.sptci.echo.list.EnumListModel |
|---|
enumClass |
| Constructor Summary | |
|---|---|
FilteredEnumListModel(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. |
void |
setFilter(E filter)
Set the filter to the single enumerated constant specified. |
void |
setFilter(Set<E> filter)
Set the value of the set used to filter out entries from the enum. |
int |
size()
Return the total number of contants in the filtered enumeration backing model. |
| 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 |
| Constructor Detail |
|---|
public FilteredEnumListModel(Class<E> cls)
cls - The enum class to use.| Method Detail |
|---|
public void setFilter(Set<E> filter)
filter - The set of enum values to filter out.public void setFilter(E filter)
filter - The enum constant to filter out of the model.public E get(int index)
get in interface ListModelget in class EnumListModel<E extends Enum>index - The index for the constant value.
ListModel.get(int)public int size()
size in interface ListModelsize in class EnumListModel<E extends Enum>ListModel.size()
|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||