Package com.ardor3d.extension.ui.model
Interface ComboBoxModel
- All Known Implementing Classes:
DefaultComboBoxModel
public interface ComboBoxModel
An interface describing a data store or model for a UIComboBox. The model should maintain a list of values for a
combo box, as well as an optional tool tip and view String override.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a new item to at the specified index in our model.int
Add a new item to the end of our model.void
clear()
Removes all items from this model.getToolTipAt
(int index) getValueAt
(int index) Get the item value at the specified index.getViewAt
(int index) void
setToolTipAt
(int index, String toolTip) Sets the tool tip for the given index.void
setValueAt
(int index, Object value) Sets the value of the item at the given index.void
Sets the view String for the given index.int
size()
-
Method Details
-
addItem
Add a new item to the end of our model.- Parameters:
value
- the value to add. value.toString() is used for the view of this value by default.- Returns:
- the index we were added at
- See Also:
-
addItem
Add a new item to at the specified index in our model. Should pad with null entries if index > current max model index.- Parameters:
index
- the index to add atvalue
- the value to add
-
getValueAt
Get the item value at the specified index.- Parameters:
index
- the index to retrieve- Returns:
- the value of the item at the given index.
-
setValueAt
Sets the value of the item at the given index. If that item already has a name or tooltip set, it is left unchanged.- Parameters:
index
- the index to add at.value
- the value to set
-
getViewAt
- Parameters:
index
- the index to retrieve- Returns:
- the view String for the given index. If no specific view is set, the value at that location is converted with toString().
-
setViewAt
Sets the view String for the given index.- Parameters:
index
- the index to add at.view
- the view String to set
-
getToolTipAt
- Parameters:
index
- the index to retrieve- Returns:
- the tool tip for the given index.
-
setToolTipAt
Sets the tool tip for the given index.- Parameters:
index
- the index to add at.toolTip
- the tool tip to set
-
size
int size()- Returns:
- the number of items, including null items, in our model.
-
clear
void clear()Removes all items from this model.
-