Class TableHeaderRenderer

java.lang.Object
com.illumon.iris.gui.table.TableHeaderRenderer
All Implemented Interfaces:
TableCellRenderer

public class TableHeaderRenderer extends Object implements TableCellRenderer
Renderer for all GuiTables. It will change the background color of the header depending on the filtering state. It will also resize the columns if auto-resize is enabled
  • Constructor Details

  • Method Details

    • getTableCellRendererComponent

      public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
      Specified by:
      getTableCellRendererComponent in interface TableCellRenderer
    • setDecorateIcons

      public void setDecorateIcons(ImageIcon decorateIcon, ImageIcon decorateHoverIcon)
      Sets the icons to use for decoration.
      Parameters:
      decorateIcon - the decorate icon
      decorateHoverIcon - the hover state of the decorate icon
    • disableDecoration

      public void disableDecoration()
      Disables the decoration.
    • enableDecoration

      public boolean enableDecoration(int column, MouseEvent e, Rectangle r)
      Enables the decoration for a specific column.
      Parameters:
      column - the column to enable
      e - the mouse event
      r - the rectangle of the header cell
      Returns:
      true if the table needs to be repainted
    • isDecorationClicked

      public boolean isDecorationClicked(int column)
      Checks if the decoration icon was clicked.
      Parameters:
      column - the column clicked on
      Returns:
      true if the decoration was clicked, false otherwise