01: package vicazh.hyperpool.stream.net.http;
02:
03: import java.util.*;
04: import vicazh.hyperpool.stream.*;
05:
06: /**
07: * The content selector table model
08: *
09: * @author Victor Zhigunov
10: * @version 0.3.9
11: */
12: public class IContentModel extends ISelectorModel {
13: private String[] names;
14:
15: /**
16: * @param name
17: * column name for time value
18: * @param index
19: * column name for index
20: * @param data
21: * data array
22: * @param names
23: * names array
24: */
25: public IContentModel(Object name, Object index,
26: final String[] data, String[] names) {
27: super (name, index, new ArrayList<Object>() {
28: public Object get(int index) {
29: return data[index];
30: }
31:
32: public int size() {
33: return data.length;
34: }
35: });
36: this .names = names;
37: }
38:
39: public boolean isCellEditable(int row, int column) {
40: return column == 1;
41: }
42:
43: public Object getValueAt(int row, int column) {
44: switch (column) {
45: case 0:
46: return names[row];
47: case 1:
48: return super.getValueAt(row, column);
49: }
50: return null;
51: }
52: }
|