01: package org.wingx.table;
02:
03: import org.wings.table.STableColumn;
04: import org.wings.table.SDefaultTableColumnModel;
05:
06: import java.util.*;
07:
08: public class XDefaultTableColumnModel extends SDefaultTableColumnModel
09: implements XTableColumnModel {
10: private Map columnByName = new HashMap();
11:
12: public XTableColumn getColumn(int columnIndex) {
13: return (XTableColumn) super .getColumn(columnIndex);
14: }
15:
16: public XTableColumn getColumn(String identifier) {
17: XTableColumn column = (XTableColumn) columnByName
18: .get(identifier);
19: if (column == null) {
20: for (Iterator iterator = getColumns().iterator(); iterator
21: .hasNext();) {
22: XTableColumn tableColumn = (XTableColumn) iterator
23: .next();
24: if (identifier.equals(tableColumn.getIdentifier())) {
25: columnByName.put(identifier, tableColumn);
26: column = tableColumn;
27: break;
28: }
29: }
30: }
31: return column;
32: }
33: }
|