T
- Type of the item stored in the model.public class ComboBoxModel<T> extends ListModel<T>
Modifier and Type | Field and Description |
---|---|
private T |
selected
Selected item.
|
private int |
selectedId
Selected item id.
|
private int |
selectedIndex
Selected index.
|
private BaseDataType |
selectedValue
Selected value.
|
Constructor and Description |
---|
ComboBoxModel() |
Modifier and Type | Method and Description |
---|---|
void |
add(T item)
Add new item at the end of model.
|
int |
calcSelection(ControlSetItem[] items)
Calculate the index position of the current selection.
|
void |
clear()
Remove all items.
|
int |
getSelectedId()
Get selected item id.
|
int |
getSelectedIndex()
Get selected index.
|
BaseDataType |
getSelectedValue()
Get selected value.
|
void |
insert(T item,
int index)
Insert item at specified location.
|
void |
remove(T item)
Remove item with specified value.
|
void |
removeAt(int index)
Remove item at specified position.
|
void |
select(T item)
Select item with specified value.
|
T |
selected()
Get selected item.
|
void |
setSelectedId(int id)
Set selected item if.
|
void |
setSelectedIndex(int index)
Set selected index.
|
void |
setSelectedValue(BaseDataType value)
Set selected index.
|
void |
setSelection(ControlSetItem[] items)
Enforce the current selection.
|
add, get, indexOf, iterator, size
private T selected
private int selectedIndex
private int selectedId
private BaseDataType selectedValue
public void add(T item)
public void insert(T item, int index)
item
- Item to insert.index
- Index at which item should be inserted.public void remove(T item)
item
- Item to remove.public void removeAt(int index)
public T selected()
public int getSelectedIndex()
public void setSelectedIndex(int index)
index
- Selected item index.public int getSelectedId()
public void setSelectedId(int id)
id
- Selected item id.public BaseDataType getSelectedValue()
public void setSelectedValue(BaseDataType value)
value
- Selected value.public void select(T item)
item
- Item value to select.public int calcSelection(ControlSetItem[] items)
items
- The list of items to be used within this drop-down list.public void setSelection(ControlSetItem[] items)
items
- The list of items to be used within this drop-down list.