Public Member Functions | |
InfoTableSorter (TableModel model) | |
int | getRowCount () |
int | getColumnCount () |
String | getColumnName (int aColumn) |
Class | getColumnClass (int aColumn) |
void | tableChanged (TableModelEvent e) |
Object | getValueAt (int aRow, int aColumn) |
void | setValueAt (Object aValue, int aRow, int aColumn) |
void | addMouseListenerToHeaderInTable (JTable table) |
Definition at line 50 of file InfoTableSorter.java.
|
Constructor
Definition at line 65 of file InfoTableSorter.java. 00066 { 00067 setModel(model); 00068 }
|
|
Add a mouse listener to the Table to trigger a table sort when a column heading is clicked in the JTable.
Definition at line 143 of file InfoTableSorter.java. References org.objectweb.cjdbc.console.views.InfoTableSorter.sortByColumn(). 00144 { 00145 final InfoTableSorter sorter = this; 00146 final JTable tableView = table; 00147 tableView.setColumnSelectionAllowed(false); 00148 MouseAdapter listMouseListener = new MouseAdapter() 00149 { 00150 public void mouseClicked(MouseEvent e) 00151 { 00152 TableColumnModel columnModel = tableView.getColumnModel(); 00153 int viewColumn = columnModel.getColumnIndexAtX(e.getX()); 00154 int column = tableView.convertColumnIndexToModel(viewColumn); 00155 if (e.getClickCount() == 1 && column != -1) 00156 { 00157 int shiftPressed = e.getModifiers() & InputEvent.SHIFT_MASK; 00158 boolean ascending = (shiftPressed == 0); 00159 sorter.sortByColumn(column, ascending); 00160 } 00161 } 00162 }; 00163 JTableHeader th = tableView.getTableHeader(); 00164 th.addMouseListener(listMouseListener); 00165 }
|
|
Definition at line 104 of file InfoTableSorter.java. 00105 {
00106 return model.getColumnClass(aColumn);
00107 }
|
|
Definition at line 88 of file InfoTableSorter.java. Referenced by org.objectweb.cjdbc.console.views.InfoViewer.ExportAction.actionPerformed(). 00089 {
00090 return (model == null) ? 0 : model.getColumnCount();
00091 }
|
|
Definition at line 96 of file InfoTableSorter.java. 00097 {
00098 return model.getColumnName(aColumn);
00099 }
|
|
Definition at line 80 of file InfoTableSorter.java. Referenced by org.objectweb.cjdbc.console.views.InfoViewer.ExportAction.actionPerformed(). 00081 {
00082 return (model == null) ? 0 : model.getRowCount();
00083 }
|
|
Definition at line 124 of file InfoTableSorter.java. Referenced by org.objectweb.cjdbc.console.views.InfoViewer.ExportAction.actionPerformed(). 00125 {
00126 return model.getValueAt(indexes[aRow], aColumn);
00127 }
|
|
Definition at line 132 of file InfoTableSorter.java. 00133 { 00134 model.setValueAt(aValue, indexes[aRow], aColumn); 00135 }
|
|
Definition at line 112 of file InfoTableSorter.java. 00113 { 00114 reallocateIndexes(); 00115 fireTableChanged(e); 00116 }
|