|
1
|
|
package abbot.editor;
|
|
2
|
|
|
|
3
|
|
import javax.swing.table.AbstractTableModel;
|
|
4
|
|
|
|
5
|
|
import abbot.Log;
|
|
6
|
|
import abbot.script.*;
|
|
7
|
|
|
|
8
|
|
|
|
9
|
|
class ReferencesModel extends AbstractTableModel {
|
|
10
|
|
private Resolver resolver;
|
|
11
|
|
|
|
12
|
12
|
public ReferencesModel(Resolver resolver) {
|
|
13
|
12
|
this.resolver = resolver;
|
|
14
|
|
}
|
|
15
|
|
|
|
16
|
10
|
public synchronized int getRowCount() {
|
|
17
|
10
|
return resolver.getComponentReferences().size();
|
|
18
|
|
}
|
|
19
|
24
|
public synchronized int getColumnCount() { return 1; }
|
|
20
|
|
|
|
21
|
0
|
public Object getValueAt(int row, int column) {
|
|
22
|
0
|
return resolver.getComponentReferences().toArray()[row];
|
|
23
|
|
}
|
|
24
|
12
|
public String getColumnName(int col) { return ""; }
|
|
25
|
0
|
public boolean isCellEditable(int row, int col) {
|
|
26
|
0
|
return false;
|
|
27
|
|
}
|
|
28
|
0
|
public Class getColumnClass(int col) {
|
|
29
|
0
|
if (col == 0)
|
|
30
|
0
|
return ComponentReference.class;
|
|
31
|
0
|
return Object.class;
|
|
32
|
|
}
|
|
33
|
|
}
|
|
34
|
|
|
|
35
|
|
|
|
36
|
|
|