1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
package com.vci.client.workflow.task;
 
import javax.swing.table.AbstractTableModel;
 
import com.vci.client.common.ConfigUtils;
import com.vci.corba.workflow.data.FlowTaskInfo;
 
public class TodoTaskTableModel extends AbstractTableModel {
 
    private static final long serialVersionUID = 7508852076471337286L;
 
    protected String[] columnIdentifiers = new String[]{};
 
    protected FlowTaskInfo[] data;
 
    public TodoTaskTableModel(){
//        columnIdentifiers = new String[] { "", "任务名称","创建人","创建人部门", "任务节点", "创建时间"};
        columnIdentifiers = new String[] { "", "流程名称","任务名称","创建人","创建人部门", "创建时间"};
    }
    
    @Override
    public String getColumnName(int column) {
        return columnIdentifiers[column];
    }
 
    public int getRowCount() {
        if (data == null) {
            return 0;
        } else {
            return data.length;
        }
    }
 
    public int getColumnCount() {
        return columnIdentifiers.length;
    }
 
    public Object getValueAt(int rowIndex, int column) {
        Object res = null;
        if (data != null && rowIndex < data.length && data.length > 0) {
            FlowTaskInfo flowTask = data[rowIndex];
//            switch (column) {
//            case 0:
//                res =  (rowIndex + 1);
//                break;
//            case 1:
//                res =  flowTask.desc;
//                break;
//            case 2:
//                res =  flowTask.applyPerson;
//                break;
//            case 3:
//                res =  flowTask.applyDeparment;
//                break;
//            case 4:
//                res =  flowTask.name;
//                break;
//            case 5:
//                res = flowTask.createTime;
//            default:
//                break;
//            }
            switch (column) {
            case 0:
                res =  (rowIndex + 1);
                break;
            case 1:
                res =  flowTask.processName;
                break;
            case 2:
                res =  flowTask.name;
                break;
            case 3:
                res =  flowTask.applyPerson;
                break;
            case 4:
                res =  flowTask.applyDeparment;
                break;
            case 5:
                res = flowTask.createTime;
            default:
                break;
            }
        }
        return res;
    }
 
    @Override
    public boolean isCellEditable(int row, int column) {
        return false;
    }
 
    public FlowTaskInfo getValue(int rowIndex) {
        if (data != null && data.length > 0) {
            return data[rowIndex];
        }
        return null;
    }
 
    public void setData(FlowTaskInfo[] data) {
        this.data = data;
        fireTableDataChanged();
    }
 
    public String[] getColumnIdentifiers() {
        return columnIdentifiers;
    }
 
    public void setColumnIdentifiers(String[] columnIdentifiers) {
        this.columnIdentifiers = columnIdentifiers;
    }
 
    public FlowTaskInfo[] getData() {
        return data;
    }
}