wangting
2024-12-26 fa261e8c1220b31af54e8167e4de9c3320b1af27
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
package com.vci.client.framework.appConfig;
 
 
import java.util.Locale;
 
import com.vci.client.LogonApplication;
import com.vci.client.framework.appConfig.object.AppConfigDetailObject;
import com.vci.client.framework.delegate.AppConfigDetailClientDelegate;
import com.vci.client.ui.exception.VCIException;
import com.vci.client.ui.locale.LocaleDisplay;
import com.vci.client.ui.swing.VCIOptionPane;
import com.vci.client.ui.swing.components.table.AbstractVCIJTableDataProvider;
import com.vci.client.ui.swing.components.table.VCIJTableNode;
 
public class AppConfigDetailDataProvider extends AbstractVCIJTableDataProvider<AppConfigDetailObject> {
 
    private IConfigDetailPanel ownerPanel = null;
    public AppConfigDetailDataProvider(IConfigDetailPanel ownerPanel){
        this.ownerPanel = ownerPanel;
    }
    
    @Override
    public String[] getSpecialColumns() {
        return "名称,KEY,VALUE,描述".split(",");
    }
 
    @Override
    public int getTotal() {
        return total;
    }
 
    @Override
    public VCIJTableNode<AppConfigDetailObject> getNewRowNode(
            AppConfigDetailObject dataObj) {
        VCIJTableNode<AppConfigDetailObject> node = new VCIJTableNode<AppConfigDetailObject>(
                dataObj);
        node.setPropertyValue(getSpecialColumns()[0], dataObj.getName());
        node.setPropertyValue(getSpecialColumns()[1], dataObj.getKey());
        node.setPropertyValue(getSpecialColumns()[2], dataObj.getValue());
        node.setPropertyValue(getSpecialColumns()[3], dataObj.getDesc());
        return node;
    }
 
    @Override
    public AppConfigDetailObject[] getDatas(int pageIndex, int pageSize) {
        AppConfigDetailObject[] objects = null;
        try {
            AppConfigDetailClientDelegate delegate = new AppConfigDetailClientDelegate(LogonApplication.getUserEntityObject());
            String clsfId = ownerPanel.getConfigCategory();
            objects = delegate.getAppConfigDetailsByID(clsfId);
            
            //System.out.println("=============查询到数据: " + objects.length);
            
        } catch (VCIException e) {
            VCIOptionPane.showError(LogonApplication.frame, LocaleDisplay.getI18nString(e, "RMIPFramework", Locale.getDefault()));
        }
        total = objects.length;
        return objects;
    }
 
}