Class JXComboBox.ComboBoxAdapter

java.lang.Object
org.jdesktop.swingx.decorator.ComponentAdapter
org.jdesktop.swingx.JXComboBox.ComboBoxAdapter
Enclosing class:
JXComboBox<E>

protected static class JXComboBox.ComboBoxAdapter extends ComponentAdapter
  • Constructor Details

    • ComboBoxAdapter

      public ComboBoxAdapter(JXComboBox<?> component)
      Constructs a ListAdapter for the specified target JXList.
      Parameters:
      component - the target list.
  • Method Details

    • getComboBox

      public JXComboBox<?> getComboBox()
      Typesafe accessor for the target component.
      Returns:
      the target component as a JXComboBox
    • isPopupVisible

      protected boolean isPopupVisible()
      A safe way to access the combo box's popup visibility.
      Returns:
      true if the popup is visible; false otherwise
    • hasFocus

      public boolean hasFocus()
      Returns true if the cell identified by this adapter currently has focus. Otherwise, it returns false.
      Specified by:
      hasFocus in class ComponentAdapter
      Returns:
      true if the cell identified by this adapter currently has focus; Otherwise, return false
    • getRowCount

      public int getRowCount()
      Returns the number of rows in the target's data model.
      Overrides:
      getRowCount in class ComponentAdapter
      Returns:
      the number of rows in the target's data model.
    • getValueAt

      public Object getValueAt(int row, int column)
      Returns the value of the target component's cell identified by the specified row and column in model coordinates.
      Specified by:
      getValueAt in class ComponentAdapter
      Parameters:
      row - in model coordinates
      column - in model coordinates
      Returns:
      the value of the target component's cell identified by the specified row and column
    • getStringAt

      public String getStringAt(int row, int column)
      Returns the String representation of the value of the cell identified by the row specified row and column in model coordinates.

      This implementation messages the StringValue.TO_STRING with the valueAt, subclasses should re-implement and use the api appropriate for the target component type. This is implemented to query the table's StringValueRegistry for an appropriate StringValue and use that for getting the string representation.

      Overrides:
      getStringAt in class ComponentAdapter
      Parameters:
      row - in model coordinates
      column - in model coordinates
      Returns:
      the value of the target component's cell identified by the specified row and column
    • getCellBounds

      public Rectangle getCellBounds()
      Returns the bounds of the cell identified by this adapter.
      Overrides:
      getCellBounds in class ComponentAdapter
      Returns:
      the bounds of the cell identified by this adapter
    • isCellEditable

      public boolean isCellEditable(int row, int column)
      Determines whether this cell is editable.
      Specified by:
      isCellEditable in class ComponentAdapter
      Parameters:
      row - the row to query in model coordinates
      column - the column to query in model coordinates
      Returns:
      true if the cell is editable, false otherwise
    • isEditable

      public boolean isEditable()
      Returns true if the cell identified by this adapter is editable, false otherwise.
      Specified by:
      isEditable in class ComponentAdapter
      Returns:
      true if the cell is editable, false otherwise
    • isSelected

      public boolean isSelected()
      Returns true if the cell identified by this adapter is currently selected. Otherwise, it returns false.
      Specified by:
      isSelected in class ComponentAdapter
      Returns:
      true if the cell identified by this adapter is currently selected; Otherwise, return false