*/
public static class XTableProperty implements PropertySupport {
public Object getSessionState(Component c) {
checkComponent(c);
JXTable table = (JXTable) c;
List<ColumnState> columnStates = new ArrayList<ColumnState>();
List<TableColumn> columns = table.getColumns(true);
List<TableColumn> visibleColumns = table.getColumns();
for (TableColumn column : columns) {
columnStates.add(new ColumnState((TableColumnExt) column,
visibleColumns.indexOf(column)));
}
XTableState tableState = new XTableState(columnStates.toArray(new ColumnState[columnStates.size()]));
tableState.setHorizontalScrollEnabled(table.isHorizontalScrollEnabled());
List<? extends SortKey> sortKeys = null;
if (table.getRowSorter() != null) {
sortKeys = table.getRowSorter().getSortKeys();
}
// PENDING: store all!
if ((sortKeys != null) && (sortKeys.size() >0)) {
tableState.setSortKey(sortKeys.get(0));
}