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.objectweb.util.explorer.swing.gui.api.DialogAction; 32 import org.objectweb.util.explorer.swing.gui.api.DialogBox; 33 import org.objectweb.util.explorer.swing.gui.lib.DefaultDialogBox; 34 import org.objectweb.util.explorer.swing.gui.lib.LabelBox; 35 import org.omg.Components.Deployment.Container; 36 37 49 public class InstallHome 50 implements MenuItem, DialogAction { 51 52 53 protected LabelBox id_; 54 55 56 protected LabelBox entryPoint_; 57 58 protected Container container_; 59 60 63 protected void createBox(DialogBox dialogBox) { 64 id_ = new LabelBox("UUID"); 65 dialogBox.addElementBox(id_); 66 entryPoint_ = new LabelBox("Entry Point"); 67 dialogBox.addElementBox(entryPoint_); 68 } 69 70 73 public int getStatus(TreeView arg0){ 74 return MenuItem.ENABLED_STATUS; 75 } 76 77 80 public void actionPerformed(MenuItemTreeView e) throws Exception { 81 container_ = (Container) e.getSelectedObject(); 82 DialogBox dia = new DefaultDialogBox("Install a home"); 83 createBox(dia); 84 dia.setValidateAction(this); 85 dia.setValidateLabel("Install"); 86 dia.setCancelLabel("Cancel"); 87 dia.show(); 88 } 89 90 93 public void executeAction() throws Exception { 94 String UUID = id_.getLabel(); 95 String entryPt = entryPoint_.getLabel(); 96 org.omg.Components.ConfigValue[] config = new org.omg.Components.ConfigValue[0]; 97 container_.install_home(UUID, entryPt, config); 98 } 99 100 } 101 102 103 104 105 | Popular Tags |