1 28 29 package org.objectweb.util.browser.plugins.fractal.panel; 30 31 import org.objectweb.fractal.api.Component; 32 import org.objectweb.fractal.api.control.ContentController; 33 import org.objectweb.util.browser.api.Table; 34 import org.objectweb.util.browser.api.TreeView; 35 import org.objectweb.util.browser.core.naming.DefaultEntry; 36 import org.objectweb.util.browser.core.naming.DefaultName; 37 import org.objectweb.util.browser.plugins.fractal.FcBrowser; 38 39 44 public class InternalComponentsTable 45 implements Table 46 { 47 53 59 65 66 69 protected ContentController provideContentController(TreeView treeView){ 70 return (ContentController)treeView.getSelectedObject(); 71 } 72 73 79 83 public String [] getHeaders(TreeView treeView) { 84 return new String [] {"Components"}; 85 } 86 87 91 public Object [][] getRows(TreeView treeView) { 92 ContentController cc = provideContentController(treeView); 93 Component[] components = cc.getFcSubComponents(); 94 Object [][] values = new Object [components.length][1]; 95 for (int i = 0 ; i < components.length ; i++){ 96 values[i] = new Object []{ new DefaultEntry(components[i], 97 new DefaultName(FcBrowser.getName(components[i])))}; 98 } 99 return values; 100 } 101 } 102 | Popular Tags |