dangsn
2024-12-26 4e9ff2ce6a830bb2340d7c8612c72eea0c5a553e
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
package com.vci.client.framework.appConfig;
 
import java.util.Locale;
 
import com.vci.client.LogonApplication;
import com.vci.client.framework.appConfig.object.AppConfigCategoryObject;
import com.vci.client.framework.delegate.AppConfigCategoryClientDelegate;
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 AppConfigCategoryDataProvider extends AbstractVCIJTableDataProvider<AppConfigCategoryObject> {
 
    private AppConfigCategoryPanel ownerPanel = null;
    public AppConfigCategoryDataProvider(AppConfigCategoryPanel ownerPanel){
        this.ownerPanel = ownerPanel;
    }
    
    @Override
    public String[] getSpecialColumns() {
        return "名称,描述".split(",");
    }
 
    @Override
    public int getTotal() {
        return total;
    }
 
    @Override
    public VCIJTableNode<AppConfigCategoryObject> getNewRowNode(
            AppConfigCategoryObject dataObj) {
        VCIJTableNode<AppConfigCategoryObject> node = new VCIJTableNode<AppConfigCategoryObject>(
                dataObj);
        node.setPropertyValue(getSpecialColumns()[0], dataObj.getName());
        node.setPropertyValue(getSpecialColumns()[1], dataObj.getDesc());
        return node;
    }
 
    @Override
    public AppConfigCategoryObject[] getDatas(int pageIndex, int pageSize) {
        AppConfigCategoryObject[] objects = null;
        try {
            AppConfigCategoryClientDelegate delegate = new AppConfigCategoryClientDelegate(LogonApplication.getUserEntityObject());
            objects = delegate.getAppConfigCategorys();
            this.total = objects.length;
        } catch (VCIException e) {
            VCIOptionPane.showError(LogonApplication.frame, LocaleDisplay.getI18nString(e, "RMIPFramework", Locale.getDefault()));
        }
        return objects;
    }
 
}