Package com.ardor3d.extension.ui.model
Class DefaultComboBoxModel
java.lang.Object
com.ardor3d.extension.ui.model.DefaultComboBoxModel
- All Implemented Interfaces:
ComboBoxModel
Default implementation of a ComboBox model.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
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()
-
Field Details
-
_elements
-
-
Constructor Details
-
DefaultComboBoxModel
public DefaultComboBoxModel() -
DefaultComboBoxModel
-
-
Method Details
-
addItem
Description copied from interface:ComboBoxModel
Add a new item to the end of our model.- Specified by:
addItem
in interfaceComboBoxModel
- 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
Description copied from interface:ComboBoxModel
Add a new item to at the specified index in our model. Should pad with null entries if index > current max model index.- Specified by:
addItem
in interfaceComboBoxModel
- Parameters:
index
- the index to add atvalue
- the value to add
-
clear
public void clear()Description copied from interface:ComboBoxModel
Removes all items from this model.- Specified by:
clear
in interfaceComboBoxModel
-
getToolTipAt
- Specified by:
getToolTipAt
in interfaceComboBoxModel
- Parameters:
index
- the index to retrieve- Returns:
- the tool tip for the given index.
-
getValueAt
Description copied from interface:ComboBoxModel
Get the item value at the specified index.- Specified by:
getValueAt
in interfaceComboBoxModel
- Parameters:
index
- the index to retrieve- Returns:
- the value of the item at the given index.
-
getViewAt
- Specified by:
getViewAt
in interfaceComboBoxModel
- 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().
-
setToolTipAt
Description copied from interface:ComboBoxModel
Sets the tool tip for the given index.- Specified by:
setToolTipAt
in interfaceComboBoxModel
- Parameters:
index
- the index to add at.toolTip
- the tool tip to set
-
setValueAt
Description copied from interface:ComboBoxModel
Sets the value of the item at the given index. If that item already has a name or tooltip set, it is left unchanged.- Specified by:
setValueAt
in interfaceComboBoxModel
- Parameters:
index
- the index to add at.value
- the value to set
-
setViewAt
Description copied from interface:ComboBoxModel
Sets the view String for the given index.- Specified by:
setViewAt
in interfaceComboBoxModel
- Parameters:
index
- the index to add at.view
- the view String to set
-
size
public int size()- Specified by:
size
in interfaceComboBoxModel
- Returns:
- the number of items, including null items, in our model.
-