1 26 package org.objectweb.openccm.explorer.Components; 27 28 29 import org.objectweb.openccm.explorer.CORBA.TypageCORBA; 30 import org.objectweb.util.explorer.api.Context; 31 import org.objectweb.util.explorer.api.Entry; 32 import org.objectweb.util.explorer.core.naming.lib.DefaultEntry; 33 34 35 import org.omg.Components.CCMHome; 36 import org.omg.Components.CCMObject; 37 38 45 public class HomeContext 46 implements Context 47 { 48 49 55 61 67 protected String getName(CCMObject o) { 68 TypageCORBA tc = new TypageCORBA(o, org.objectweb.openccm.corba.TheORB.getORB()); 69 return tc.getTypeID(); 70 } 71 72 78 public Entry[] getEntries(Object object) { 79 CCMHome home = (CCMHome)object; 80 CCMObject[] objects = home.get_components(); 81 Entry[] values = new Entry[objects.length]; 82 for (int i = 0; i < objects.length; i++) 83 values[i] = new DefaultEntry(getName(objects[i]) + " (" + i + ")", objects[i]); 84 return values; 85 } 86 87 } 88 | Popular Tags |