1 28 29 package org.objectweb.util.browser.plugins.fractal.panel; 30 31 import org.objectweb.fractal.api.Interface; 32 import org.objectweb.fractal.api.type.InterfaceType; 33 import org.objectweb.util.browser.api.Entry; 34 import org.objectweb.util.browser.api.Table; 35 import org.objectweb.util.browser.api.TreeView; 36 import org.objectweb.util.browser.api.Wrapper; 37 import org.objectweb.util.browser.core.naming.DefaultEntry; 38 import org.objectweb.util.browser.core.naming.DefaultName; 39 import org.objectweb.util.browser.plugins.fractal.context.ControllerContainer; 40 import org.objectweb.util.browser.plugins.fractal.lib.SignatureWrapper; 41 42 47 public class ControllerContainerTable 48 implements Table 49 { 50 51 57 63 69 72 protected Object [] getValues(Entry entry){ 73 Interface itf = null; 74 if (Wrapper.class.isAssignableFrom(entry.getValue().getClass())) 75 itf = (Interface)((Wrapper)entry.getValue()).getWrapped(); 76 else if (Interface.class.isAssignableFrom(entry.getValue().getClass())) 77 itf = (Interface)entry.getValue(); 78 Object [] values = new Object [2]; 79 String signature = ""; 80 if(itf!=null) 81 signature = ((InterfaceType)itf.getFcItfType()).getFcItfSignature(); 82 values[0] = entry; 83 values[1] = new DefaultEntry(new SignatureWrapper(signature),new DefaultName(signature)); 84 return values; 85 } 86 87 93 97 public String [] getHeaders(TreeView treeView) { 98 return new String [] {"Controller","Signature"}; 99 } 100 101 105 public Object [][] getRows(TreeView treeView) { 106 ControllerContainer cc = (ControllerContainer)treeView.getSelectedObject(); 107 Entry[] entries = cc.getEntries(); 108 Object [][] values = new Object [entries.length][2]; 109 for (int i = 0 ; i < entries.length ; i++) { 110 values[i] = getValues(entries[i]); 111 } 112 return values; 113 } 114 } 115 | Popular Tags |