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 list = new ArrayList(); 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(); // } // } }