Class FlatTableCellBorder.Selected

All Implemented Interfaces:
Serializable, Border, UIResource
Enclosing class:
FlatTableCellBorder

public static class FlatTableCellBorder.Selected extends FlatTableCellBorder
Border for selected cell that uses margins and paints focus indicator border. The focus indicator is shown under following conditions:
  • always if enabled via UI property Table.showCellFocusIndicator=true
  • for row selection mode if exactly one row is selected and at least one cell in that row is editable
  • for column selection mode if exactly one column is selected and at least one cell in that column is editable
  • never for cell selection mode
The reason for this logic is to hide the focus indicator when it is not needed, and only show it when there are editable cells and the user needs to know which cell is focused to start editing.

To avoid possible performance issues, checking for editable cells is limited to maxCheckCellsEditable. If there are more cells to check, the focus indicator is always shown.

See Also:
  • Field Details

    • maxCheckCellsEditable

      public int maxCheckCellsEditable
      Since:
      3.1
  • Constructor Details

    • Selected

      public Selected()
  • Method Details

    • paintBorder

      public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
      Specified by:
      paintBorder in interface Border
      Overrides:
      paintBorder in class FlatTableCellBorder
    • shouldShowCellFocusIndicator

      protected boolean shouldShowCellFocusIndicator(JTable table)
      Returns whether focus indicator border should be shown.
      Since:
      3.1