1 23 package org.enhydra.kelp.common.deployer; 24 25 import org.enhydra.tool.common.ButtonPanel; 27 28 import java.awt.Window ; 30 import java.awt.event.ActionEvent ; 31 import java.awt.event.ActionListener ; 32 import java.lang.ref.WeakReference ; 33 public class DeployButtonListener implements ActionListener { 35 private WeakReference ref = null; 36 37 public DeployButtonListener(CoreDeployTool tool) { 38 ref = new WeakReference (tool); 39 } 40 41 public void actionPerformed(ActionEvent event) { 42 String command = event.getActionCommand(); 43 if (command.equals(ButtonPanel.COMMAND_BACK)) { 44 getTool().back(); 45 } else if (command.equals(ButtonPanel.COMMAND_NEXT)) { 46 getTool().next(); 47 } else if (command.equals(ButtonPanel.COMMAND_DEPLOY)) { 48 getTool().deploy(); 49 } else if (command.equals(ButtonPanel.COMMAND_CLOSE)) { 50 getTool().closeWindow(); 51 } else if (command.equals(ButtonPanel.COMMAND_HELP)) { 52 getTool().notifyHelpListeners(event.getSource()); 53 } else if (command.equals(ButtonPanel.COMMAND_ABOUT)) { 54 getTool().showAbout(); 55 } 56 } 57 58 private CoreDeployTool getTool() { 59 return (CoreDeployTool) ref.get(); 60 } 61 62 } 63 | Popular Tags |