1 26 package org.objectweb.openccm.explorer.DCI; 27 28 import org.omg.Components.Cookie; 29 import org.omg.Components.Deployment.AssemblyFactory; 30 import org.objectweb.openccm.OpenCCM_DCI.AssemblyFactoryManager; 31 import org.objectweb.util.explorer.api.MenuItem; 32 import org.objectweb.util.explorer.api.MenuItemTreeView; 33 import org.objectweb.util.explorer.api.TreeView; 34 35 import javax.swing.JOptionPane ; 36 37 45 public class DestroyAssembly 46 implements MenuItem 47 { 48 49 55 61 67 73 76 public int getStatus(TreeView arg0){ 77 return MenuItem.ENABLED_STATUS; 78 } 79 80 83 public void actionPerformed(MenuItemTreeView e) throws Exception { 84 if(JOptionPane.showConfirmDialog(null,"Do you really want to destroy this assembly ?", "Destroy action", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE)==0){ 85 86 AssemblyFactoryManager assemblyFactoryManager = (AssemblyFactoryManager)e.getParentObject(); 88 AssemblyFactory assemblyFactory = assemblyFactoryManager.provide_assembly_factory(); 89 90 AssemblyManagerWrapperWithCookie assemblyManagerWrapper = (AssemblyManagerWrapperWithCookie)e.getSelectedObject(); 92 Cookie cookie = assemblyManagerWrapper.getCookie(); 93 94 assemblyFactory.destroy(cookie); 96 } 97 98 } 99 } | Popular Tags |