1 26 27 package org.objectweb.openccm.explorer.DCI; 28 29 import org.objectweb.openccm.OpenCCM_DCI.AssemblyManager; 30 import org.objectweb.openccm.OpenCCM_DCI.AssemblyFactoryManager; 31 import org.objectweb.openccm.OpenCCM_DCI.AssemblyFactoryManagerPackage.assembly_managersConnection; 32 import org.objectweb.util.explorer.api.Table; 33 import org.objectweb.util.explorer.api.TreeView; 34 import org.objectweb.util.explorer.core.naming.lib.DefaultEntry; 35 36 43 public class AssemblyFactoryManagerTable 44 implements Table 45 { 46 47 53 59 65 68 protected String getName(AssemblyManager assemblyManager){ 69 String returnedValue = "Assembly "; 70 String assemblyId = assemblyManager.ass_id(); 71 if(assemblyId.indexOf(":")!=-1) 72 returnedValue = assemblyId.substring(0,assemblyId.indexOf(":")); 73 return returnedValue; 74 } 75 76 82 85 public String [] getHeaders(TreeView treeView) { 86 return new String []{"Assembly"}; 87 } 88 89 92 public Object [][] getRows(TreeView treeView) { 93 AssemblyFactoryManager assemblyFactoryManager = (AssemblyFactoryManager)treeView.getSelectedObject(); 94 assembly_managersConnection[] assemblyManagerList = assemblyFactoryManager.get_connections_assembly_managers(); 95 Object [][] contenu = new Object [assemblyManagerList.length][1]; 96 for (int i=0 ; i<assemblyManagerList.length ; i++){ 97 assembly_managersConnection assemblyManagerConnection = assemblyManagerList[i]; 98 AssemblyManagerWrapperWithCookie assemblyManagerWrapper = new AssemblyManagerWrapperWithCookie(); 99 assemblyManagerWrapper.setAssemblyFactory(assemblyFactoryManager.provide_assembly_factory()); 100 assemblyManagerWrapper.setCookie(assemblyManagerConnection.ck); 101 assemblyManagerWrapper.setAssemblyManager(assemblyManagerConnection.objref); 102 contenu[i][0] = new DefaultEntry(getName(assemblyManagerConnection.objref)+ " (" + (i+1) + ")", assemblyManagerWrapper); 103 } 104 return contenu; 105 } 106 } 107 | Popular Tags |