1 26 27 package org.objectweb.util.browser.plugin.java; 28 29 import java.util.Enumeration ; 30 import java.util.Properties ; 31 32 import org.objectweb.util.browser.api.Table; 33 import org.objectweb.util.browser.api.TreeView; 34 35 43 public class PropertiesTable implements Table { 44 45 51 57 63 69 73 public String [] getHeaders(TreeView treeView) { 74 return new String []{"Keys","Values"}; 75 } 76 77 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 |