1 26 package org.objectweb.openccm.explorer.Deployment; 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.Deployment.Assembly; 32 33 43 public class BuildAssembly 44 implements MenuItem 45 { 46 47 protected Assembly getAssembly(TreeView e){ 48 return (Assembly)e.getSelectedObject(); 49 } 50 51 55 public int getStatus(TreeView e){ 56 Assembly assembly = getAssembly(e); 57 org.omg.Components.Deployment.AssemblyState state = assembly.get_state(); 58 if(state.equals(org.omg.Components.Deployment.AssemblyState.INACTIVE)) 59 return MenuItem.ENABLED_STATUS; 60 else 61 return MenuItem.DISABLED_STATUS; 62 } 63 64 67 public void actionPerformed(MenuItemTreeView e) throws Exception { 68 Assembly assembly = getAssembly(e); 69 assembly.build(); 70 } 71 72 } | Popular Tags |