|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xnap.gui.table.SortButtonRenderer
public class SortButtonRenderer
Don't use this class directly. Use
TableHeaderListener.install() instead.
If an instance of this class is set as the header renderer for a table,
xnap.gui.table.TableHeaderListener| Field Summary | |
|---|---|
static javax.swing.Icon |
downIcon
|
static javax.swing.Icon |
upIcon
|
| Constructor Summary | |
|---|---|
SortButtonRenderer(javax.swing.table.TableCellRenderer renderer)
Constructs a SortButtonRenderer. |
|
| Method Summary | |
|---|---|
javax.swing.Icon |
getIcon(int col)
Returns the icon of col. |
java.awt.Component |
getTableCellRendererComponent(javax.swing.JTable table,
java.lang.Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column)
|
void |
selectColumn(int col)
|
void |
setSortedColumn(int col,
boolean ascending)
Prints the arrow icon to the column at index col. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final javax.swing.Icon downIcon
public static final javax.swing.Icon upIcon
| Constructor Detail |
|---|
public SortButtonRenderer(javax.swing.table.TableCellRenderer renderer)
renderer is used
to renderer the header. This needs to be an instance of
JLabel for the sort arrow to be displayed.
This implementation uses the setIcon() method of JLabel to display the arrow icon. Make sure you do not use the icon of the renderer.
renderer - the default renderer| Method Detail |
|---|
public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table,
java.lang.Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column)
getTableCellRendererComponent in interface javax.swing.table.TableCellRendererpublic void selectColumn(int col)
public void setSortedColumn(int col,
boolean ascending)
col.
public javax.swing.Icon getIcon(int col)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||