1 26 27 package org.objectweb.util.browser.core.panel; 28 29 import org.objectweb.util.browser.api.Entry; 30 import org.objectweb.util.browser.api.Table; 31 import org.objectweb.util.browser.api.TreeView; 32 import org.objectweb.util.browser.api.Context; 33 import org.objectweb.util.browser.core.api.ExtendedEntry; 34 35 43 public class ContextTable implements Table { 44 45 51 57 63 69 73 public String [] getHeaders(TreeView treeView) { 74 return new String []{"Entry name","Object"}; 75 } 76 77 81 public Object [][] getRows(TreeView treeView) { 82 Context context = (Context) treeView.getSelectedEntry().getValue(); 83 if (context != null) { 84 Entry[] entries = context.getEntries(); 85 Object [][] values = new Object [entries.length][2]; 86 for (int i = 0; i < entries.length; i++) { 87 Entry entry = entries[i]; 88 if(entry!=null){ 89 values[i] = new Object []{entry.getName(),((ExtendedEntry)entry).getWrappedObject()}; 90 } 91 } 92 return values; 93 } 94 return null; 95 } 96 97 } 98 99 | Popular Tags |