1 package org.enhydra.kelp.ant.deployer; 2 3 11 12 import org.enhydra.tool.common.ButtonPanel; 14 15 import java.awt.Window ; 17 import java.awt.event.ActionEvent ; 18 import java.awt.event.ActionListener ; 19 import java.lang.ref.WeakReference ; 20 21 22 public class AntDeployButtonListener implements ActionListener { 23 private WeakReference ref = null; 24 25 public AntDeployButtonListener(AntDeployTool tool) { 26 ref = new WeakReference (tool); 27 } 28 29 36 public void actionPerformed(ActionEvent event) { 37 String command = event.getActionCommand(); 38 39 if (command.equals(ButtonPanel.COMMAND_CANCEL)) { 40 getTool().closeWindow(); 41 } else if (command.equals(ButtonPanel.COMMAND_DEPLOY)) { 42 getTool().getProject().save(); 43 getTool().build(); 44 } else if (command.equals(ButtonPanel.COMMAND_CLOSE)) { 45 getTool().getProject().save(); 46 getTool().closeWindow(); 47 } else if (command.equals(ButtonPanel.COMMAND_HELP)) { 48 getTool().showHelp(null); 50 } else if (command.equals(ButtonPanel.COMMAND_ABOUT)) { 51 getTool().showAbout(); 52 } 53 } 54 55 private AntDeployTool getTool() { 56 return (AntDeployTool) ref.get(); 57 } 58 59 } 60 61 | Popular Tags |