Package com.illumon.iris.gui.table
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 Summary
Constructors Constructor Description TableHeaderRenderer(TableCellRenderer tableCellRenderer)
TableHeaderRenderer(TableCellRenderer tableCellRenderer, MultiModelTable model)
-
Method Summary
Modifier and Type Method Description void
disableDecoration()
Disables the decoration.boolean
enableDecoration(int column, MouseEvent e, Rectangle r)
Enables the decoration for a specific column.Component
getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
boolean
isDecorationClicked(int column)
Checks if the decoration icon was clicked.void
setDecorateIcons(ImageIcon decorateIcon, ImageIcon decorateHoverIcon)
Sets the icons to use for decoration.
-
Constructor Details
-
Method Details
-
getTableCellRendererComponent
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)- Specified by:
getTableCellRendererComponent
in interfaceTableCellRenderer
-
setDecorateIcons
Sets the icons to use for decoration.- Parameters:
decorateIcon
- the decorate icondecorateHoverIcon
- the hover state of the decorate icon
-
disableDecoration
public void disableDecoration()Disables the decoration. -
enableDecoration
Enables the decoration for a specific column.- Parameters:
column
- the column to enablee
- the mouse eventr
- 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
-