Class DefaultComboBoxModel

java.lang.Object
com.ardor3d.extension.ui.model.DefaultComboBoxModel
All Implemented Interfaces:
ComboBoxModel

public class DefaultComboBoxModel extends Object implements ComboBoxModel
Default implementation of a ComboBox model.
  • Field Details

  • Constructor Details

    • DefaultComboBoxModel

      public DefaultComboBoxModel()
    • DefaultComboBoxModel

      public DefaultComboBoxModel(Object... data)
  • Method Details

    • addItem

      public int addItem(Object value)
      Description copied from interface: ComboBoxModel
      Add a new item to the end of our model.
      Specified by:
      addItem in interface ComboBoxModel
      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

      public void addItem(int index, Object value)
      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 interface ComboBoxModel
      Parameters:
      index - the index to add at
      value - the value to add
    • clear

      public void clear()
      Description copied from interface: ComboBoxModel
      Removes all items from this model.
      Specified by:
      clear in interface ComboBoxModel
    • getToolTipAt

      public String getToolTipAt(int index)
      Specified by:
      getToolTipAt in interface ComboBoxModel
      Parameters:
      index - the index to retrieve
      Returns:
      the tool tip for the given index.
    • getValueAt

      public Object getValueAt(int index)
      Description copied from interface: ComboBoxModel
      Get the item value at the specified index.
      Specified by:
      getValueAt in interface ComboBoxModel
      Parameters:
      index - the index to retrieve
      Returns:
      the value of the item at the given index.
    • getViewAt

      public String getViewAt(int index)
      Specified by:
      getViewAt in interface ComboBoxModel
      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

      public void setToolTipAt(int index, String toolTip)
      Description copied from interface: ComboBoxModel
      Sets the tool tip for the given index.
      Specified by:
      setToolTipAt in interface ComboBoxModel
      Parameters:
      index - the index to add at.
      toolTip - the tool tip to set
    • setValueAt

      public void setValueAt(int index, Object value)
      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 interface ComboBoxModel
      Parameters:
      index - the index to add at.
      value - the value to set
    • setViewAt

      public void setViewAt(int index, String view)
      Description copied from interface: ComboBoxModel
      Sets the view String for the given index.
      Specified by:
      setViewAt in interface ComboBoxModel
      Parameters:
      index - the index to add at.
      view - the view String to set
    • size

      public int size()
      Specified by:
      size in interface ComboBoxModel
      Returns:
      the number of items, including null items, in our model.