1 26 package org.objectweb.openccm.explorer.DCI; 27 28 import org.ist.coach.DCI.DCIDeployment; 29 import org.objectweb.util.explorer.api.MenuItem; 30 import org.objectweb.util.explorer.api.MenuItemTreeView; 31 import org.objectweb.util.explorer.api.TreeView; 32 33 import javax.swing.JOptionPane ; 34 35 42 public class DestroyAssemblyWithDCIDeployment 43 implements MenuItem 44 { 45 46 49 public int getStatus(TreeView arg0) { 50 return MenuItem.ENABLED_STATUS; 51 } 52 53 56 public void actionPerformed(MenuItemTreeView menuItem) throws Exception { 57 if(JOptionPane.showConfirmDialog(null,"Do you really want to destroy this assembly ?", "Destroy action", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE)==0){ 58 AssemblyManagerWrapperWithDCIDeployment assemblyManager = (AssemblyManagerWrapperWithDCIDeployment)menuItem.getSelectedObject(); 59 DCIDeployment DCIDeploy = assemblyManager.getDCIDeployment(); 60 String uuid = assemblyManager.getUUID(); 61 DCIDeploy.destroy_assembly_instance(uuid); 62 } 63 } 64 65 } 66 | Popular Tags |