1 26 27 package org.objectweb.openccm.explorer.CORBA; 28 29 import org.objectweb.openccm.explorer.CORBA.ConsoleFactory; 30 import org.objectweb.util.explorer.api.Table; 31 import org.objectweb.util.explorer.api.TreeView; 32 import org.objectweb.util.explorer.core.naming.lib.DefaultEntry; 33 34 41 public class CORBAAttributesTable 42 extends CORBAAttributes 43 implements Table 44 { 45 46 52 58 64 70 73 public String [] getHeaders(TreeView treeView) { 74 return new String []{"Name","Value"}; 75 } 76 77 80 public Object [][] getRows(TreeView treeView) { 81 org.omg.CORBA.Object obj = (org.omg.CORBA.Object )treeView.getSelectedObject(); 82 java.util.Vector values = new java.util.Vector (); 83 84 for(int i=0 ; i<attributesName_.length ; i++){ 85 if(exists(attributesName_[i],obj)){ 86 String name = attributesName_[i]; 87 try{ 88 Object returnValue = obj.getClass().getMethod(name,null).invoke(obj,null); 89 String value = returnValue!=null?returnValue.toString():null; 90 values.add(new Object []{name, new DefaultEntry(value, new ViewAttributeWrapper(name,obj))}); 91 } catch(Exception e) { 92 ConsoleFactory.getDebugConsole().add("[" + getClass().getName() + "] " + name + "() method not found!\n"); 93 } 94 } 95 } 96 97 Object [][] contents = new Object [values.size()][2]; 98 for(int i=0 ; i<values.size() ; i++) 99 contents[i] = (Object [])values.get(i); 100 101 return contents; 102 103 } 104 105 } 106 | Popular Tags |