|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jidesoft.grid.FilterableTableHeaderCellDecorator
public class FilterableTableHeaderCellDecorator
This class is to paint filter button. By default, it will not paint anything on the header cell. When the mouse is over the header, it will paint a filter icon on the right side of the cell. Clicking on it will bring up the drop down list for auto-filter. If a column has filters, then a filter icon will remain on the cell even the mouse is not over.
Field Summary | |
---|---|
static int |
GAP
|
Constructor Summary | |
---|---|
FilterableTableHeaderCellDecorator()
|
Method Summary | |
---|---|
Insets |
getInsets(Graphics g,
JTableHeader header,
int columnIndex,
Rectangle cellRect)
Gets the margin insets where this cell decorator will paint in. |
boolean |
isShowVerticalLine()
Gets the flag indicating if the vertical line to separate the column name and the filter icon should be painted. |
protected boolean |
needPaintFilterIcon(JTableHeader header,
int columnIndex)
Checks if the decorator should paint filter icon for the visual column index of the table header. |
void |
paint(Graphics g,
JTableHeader header,
int columnIndex,
Rectangle cellRect,
boolean mouseOverPaintArea)
Paints the table header cell. |
void |
setShowVerticalLine(boolean showVerticalLine)
Sets the flag indicating if the vertical line to separate the column name and the filter icon should be painted. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int GAP
Constructor Detail |
---|
public FilterableTableHeaderCellDecorator()
Method Detail |
---|
public Insets getInsets(Graphics g, JTableHeader header, int columnIndex, Rectangle cellRect)
TableHeaderCellDecorator
getInsets
in interface TableHeaderCellDecorator
g
- the Graphics instanceheader
- the table headercolumnIndex
- the view column index to be paintedcellRect
- the original cell rectangle for the column
public void paint(Graphics g, JTableHeader header, int columnIndex, Rectangle cellRect, boolean mouseOverPaintArea)
TableHeaderCellDecorator
TableHeaderCellDecorator.getInsets(java.awt.Graphics, javax.swing.table.JTableHeader,
int, java.awt.Rectangle)
, i.e., paint only in the area as specified in the insets. You do need to consider both
RTL and LTR orientations in your code when doing the painting.
paint
in interface TableHeaderCellDecorator
g
- the Graphics instanceheader
- the table headercolumnIndex
- the view column index to be paintedcellRect
- the original cell rectangle for the columnmouseOverPaintArea
- the flag indicating if the mouse is over the paint area of this cell decoratorprotected boolean needPaintFilterIcon(JTableHeader header, int columnIndex)
header
- the table headercolumnIndex
- the visual column index, could be negative when it is a group column
public boolean isShowVerticalLine()
setShowVerticalLine(boolean)
public void setShowVerticalLine(boolean showVerticalLine)
showVerticalLine
- the flag
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |