1 26 package org.objectweb.openccm.explorer.DCI; 27 28 import org.objectweb.util.explorer.api.MenuItem; 29 import org.objectweb.util.explorer.api.MenuItemTreeView; 30 import org.objectweb.util.explorer.api.TreeView; 31 import org.omg.Components.Cookie; 32 import org.omg.Components.Deployment.AssemblyFactory; 33 import javax.swing.JOptionPane ; 34 35 43 public class DestroyAssemblyWithCookie 44 implements MenuItem 45 { 46 47 53 59 65 71 74 public int getStatus(TreeView treeView){ 75 return MenuItem.ENABLED_STATUS; 76 } 77 78 81 public void actionPerformed(MenuItemTreeView e) throws Exception { 82 if(JOptionPane.showConfirmDialog(null,"Do you really want to destroy this assembly ?", "Destroy action", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE)==0){ 83 84 AssemblyManagerWrapperWithCookie assemblyManagerWrapper = (AssemblyManagerWrapperWithCookie)e.getSelectedObject(); 86 Cookie cookie = assemblyManagerWrapper.getCookie(); 87 AssemblyFactory assemblyFactory = assemblyManagerWrapper.getAssemblyFactory(); 88 89 assemblyFactory.destroy(cookie); 91 } 92 93 } 94 } | Popular Tags |