Revision 8146 trunk/libraries/libJCRS/src/org/gvsig/crs/gui/panels/CrsRecentsPanel.java
CrsRecentsPanel.java | ||
---|---|---|
10 | 10 |
import javax.swing.JScrollPane; |
11 | 11 |
import javax.swing.JTable; |
12 | 12 |
import javax.swing.ListSelectionModel; |
13 |
import javax.swing.event.TableModelListener; |
|
13 | 14 |
import javax.swing.table.DefaultTableModel; |
14 | 15 |
import javax.swing.table.TableColumn; |
15 | 16 |
|
... | ... | |
33 | 34 |
public JTable jTable = null; |
34 | 35 |
private JScrollPane jScrollPane = null; |
35 | 36 |
public DefaultTableModel dtm = null; |
37 |
public TableSorter sorter = null; |
|
36 | 38 |
private CrsData crsDataArray[] = null; |
37 | 39 |
|
38 | 40 |
public int selectedRowTable = -1; |
... | ... | |
100 | 102 |
public boolean isCellEditable(int row, int column) { |
101 | 103 |
return false; |
102 | 104 |
} |
105 |
/* |
|
106 |
* metodo necesario para cuando utilizamos tablas ordenadas |
|
107 |
* ya que sino al ordenar por algun campo no se queda con el orden |
|
108 |
* actual al seleccionar una fila (non-Javadoc) |
|
109 |
* @see javax.swing.table.TableModel#getColumnClass(int) |
|
110 |
*/ |
|
111 |
public Class getColumnClass(int column) |
|
112 |
{ |
|
113 |
return getValueAt(0, column).getClass(); |
|
114 |
} |
|
103 | 115 |
}; |
104 |
TableSorter sorter = new TableSorter(dtm);
|
|
116 |
sorter = new TableSorter(dtm); |
|
105 | 117 |
|
106 | 118 |
jTable = new JTable(sorter); |
107 |
sorter.setTableHeader(jTable.getTableHeader());
|
|
119 |
sorter.setTableHeader(jTable.getTableHeader()); |
|
108 | 120 |
jTable.setCellSelectionEnabled(false); |
109 | 121 |
jTable.setRowSelectionAllowed(true); |
110 | 122 |
jTable.setColumnSelectionAllowed(false); |
... | ... | |
121 | 133 |
column.setPreferredWidth(160); |
122 | 134 |
} |
123 | 135 |
} |
124 |
} |
|
136 |
}
|
|
125 | 137 |
return jTable; |
126 | 138 |
} |
127 | 139 |
|
Also available in: Unified diff