ludc
2025-01-16 986aa62ed00bee39363bab41b4eeb8259d446efd
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
package com.vci.client.omd.versionrule.ui;
 
import java.util.ArrayList;
import java.util.List;
 
import javax.swing.JList;
 
import com.vci.client.omd.versionrule.VRClientStart;
import com.vci.corba.omd.vrm.VersionRule;
@SuppressWarnings("all") 
public class VersionRuleList extends JList{
    /**
         * 
    */
    private static final long serialVersionUID = 1L;
    List<String> list = new ArrayList<String>();
    String versionrulename=null;
    
//    public VersionRuleList() throws PlmomdError{
//        try {
//            VersionRule();
//        } catch (Exception e) {
//            // TODO Auto-generated catch block
//            e.printStackTrace();
//        }
//    }
    
    @SuppressWarnings("rawtypes")
    public String[] getVersionRules(){
        try {
            VersionRule[] versionRules = VRClientStart.getService().getVersionRules();
            for(VersionRule vr:versionRules){
                versionrulename = vr.name;
//                System.out.println("versionrulename========"+versionrulename);
                list.add(versionrulename);
            }
            return list.toArray(new String[0]);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return null;
    }
    
    //added by zhouhui
//    public static void main(String[] args){
//        VersionRuleList v = new VersionRuleList();
//        try {
//            v.VersionRule();
//        } catch (DocumentException e) {
//            e.printStackTrace();
//        } catch (PlmomdError e) {
//            // TODO Auto-generated catch block
//            e.printStackTrace();
//        }
//    }    
}