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
package com.vci.client.workflow.task;
 
import javax.swing.table.AbstractTableModel;
 
import com.vci.corba.workflow.data.FlowApproveHistoryInfo;
 
public class HistoryTableModelByPlatform extends AbstractTableModel {
 
    /**
     * 
     */
    private static final long serialVersionUID = 7508852076471337286L;
 
    private String[] columnIdentifiers = new String[] { "模板名称", "任务名称", "执行人",
            "处理意见", "创建时间", "结束时间", "备注" };
 
    private FlowApproveHistoryInfo[] data;
 
    private String[] executionIds;
 
    @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) {
        if (data != null && data.length > 0) {
            FlowApproveHistoryInfo flowApproveHistory = data[rowIndex];
            switch (column) {
            case 0:
                return flowApproveHistory.executionId.replace(".", ",").split(",")[0];
            case 1:
                return flowApproveHistory.taskName;
            case 2:
                return flowApproveHistory.assignee;
            case 3:
                return flowApproveHistory.opinion;
            case 4:
                return flowApproveHistory.createTime;
            case 5:
                return flowApproveHistory.endTime;
            case 6:
                return flowApproveHistory.note;
            default:
                break;
            }
        }
        return null;
    }
 
    @Override
    public boolean isCellEditable(int row, int column) {
        return false;
    }
 
    public FlowApproveHistoryInfo getValue(int rowIndex) {
        if (data != null && data.length > 0) {
            return data[rowIndex];
        }
        return null;
    }
 
    public void setData(FlowApproveHistoryInfo[] data) {
        this.data = data;
    }
 
}