01: package com.opensymphony.workflow.designer.model;
02:
03: import com.opensymphony.workflow.loader.ValidatorDescriptor;
04: import com.opensymphony.workflow.designer.ResourceManager;
05:
06: /**
07: * @author Hani Suleiman (hani@formicary.net)
08: * Date: May 20, 2003
09: * Time: 11:04:16 AM
10: */
11: public class ValidatorsTableModel extends ListTableModel {
12: private String[] header = new String[] { ResourceManager
13: .getString("type") };
14:
15: public ValidatorsTableModel() {
16: }
17:
18: public boolean isCellEditable(int rowIndex, int columnIndex) {
19: return false;
20: }
21:
22: public int getColumnCount() {
23: return header.length;
24: }
25:
26: public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
27: ValidatorDescriptor validator = (ValidatorDescriptor) list
28: .get(rowIndex);
29: switch (columnIndex) {
30: case 0:
31: if (aValue != null)
32: validator.setType(aValue.toString());
33: break;
34: }
35: }
36:
37: public String getColumnName(int column) {
38: return header[column];
39: }
40:
41: public Class getColumnClass(int columnIndex) {
42: switch (columnIndex) {
43: case 0:
44: return String.class;
45: default:
46: return String.class;
47: }
48: }
49:
50: public Object getValueAt(int rowIndex, int columnIndex) {
51: ValidatorDescriptor validator = (ValidatorDescriptor) list
52: .get(rowIndex);
53: switch (columnIndex) {
54: case 0:
55: return validator.getType();
56: default:
57: return "";
58: }
59: }
60: }
|