1 28 29 package org.objectweb.util.browser.plugins.fractal.context; 30 31 import java.util.List ; 32 import java.util.Vector ; 33 34 import org.objectweb.fractal.api.Component; 35 import org.objectweb.fractal.api.Interface; 36 import org.objectweb.fractal.api.control.BindingController; 37 import org.objectweb.util.browser.api.Entry; 38 import org.objectweb.util.browser.core.naming.AbstractContext; 39 import org.objectweb.util.browser.core.naming.DefaultEntry; 40 import org.objectweb.util.browser.core.naming.DefaultName; 41 import org.objectweb.util.browser.plugins.fractal.FcBrowser; 42 43 48 public class InterfaceContext 49 extends AbstractContext 50 { 51 52 protected InterfaceWrapper interfaceWrapper ; 53 54 57 protected InterfaceWrapper getInterfaceWrapper() { 58 return interfaceWrapper; 59 } 60 61 64 protected void setInterfaceWrapper(InterfaceWrapper interfaceWrapper) { 65 this.interfaceWrapper = interfaceWrapper; 66 } 67 68 71 public Entry[] getEntries(Interface itf) { 72 List l = new Vector (); 73 Component ci = itf.getFcItfOwner(); 74 Interface bindInterface = null; 75 try { 76 BindingController bc = FcBrowser.getBindingController(ci); 77 bindInterface = (Interface)bc.lookupFc(itf.getFcItfName()); 78 } catch(Exception e) { } 79 if(bindInterface!=null) 80 l.add(new DefaultEntry(bindInterface, 81 new DefaultName(FcBrowser.getPrefixedName(bindInterface)), 82 this)); 83 return (Entry[])l.toArray(new Entry[0]); 84 } 85 86 89 public Entry[] getEntries() { 90 return getEntries(getInterfaceWrapper().getItf()); 91 } 92 93 96 public void setWrapped(Object object) { 97 setInterfaceWrapper((InterfaceWrapper) object); 98 } 99 100 103 public Object getWrapped() { 104 return getInterfaceWrapper(); 105 } 106 } 107 | Popular Tags |