1 26 27 package org.objectweb.util.explorer.plugin.java; 28 29 import java.util.Enumeration ; 30 import java.util.Properties ; 31 32 import org.objectweb.util.explorer.api.Table; 33 import org.objectweb.util.explorer.api.TreeView; 34 35 43 public class PropertiesTable 44 implements Table 45 { 46 47 53 59 65 71 74 public String [] getHeaders(TreeView treeView) { 75 return new String []{"Keys","Values"}; 76 } 77 78 81 public Object [][] getRows(TreeView treeView) { 82 Properties properties = (Properties )treeView.getSelectedObject(); 83 Enumeration keys, elements; 84 keys = properties.keys(); 85 elements = properties.elements(); 86 Object [][] contenu = new String [properties.size()][2]; 87 for (int i = 0; i < properties.size(); i++) { 88 contenu[i] = new String []{(String ) keys.nextElement(),(String )elements.nextElement()}; 89 } 90 return contenu; 91 } 92 93 } 94 95 | Popular Tags |