1 4 package org.webdocwf.util.loader.wizard; 5 6 import java.awt.Toolkit ; 7 import java.awt.event.ActionEvent ; 8 9 import javax.swing.AbstractAction ; 10 import javax.swing.ImageIcon ; 11 import javax.swing.JOptionPane ; 12 import javax.swing.KeyStroke ; 13 14 19 public class CloseOctopusProjectAction extends AbstractAction { 20 21 22 OctopusProjectFrame octopusProjectFrame; 23 24 27 public CloseOctopusProjectAction(OctopusProjectFrame octopusProjectFrame, String label) { 28 29 this.octopusProjectFrame = octopusProjectFrame; 30 putValue(NAME, label); 31 putValue( 32 SMALL_ICON, 33 new ImageIcon ( 34 getClass().getClassLoader().getResource( 35 "org/webdocwf/util/loader/" + "wizard/images/Stop.gif"))); 36 putValue(SHORT_DESCRIPTION, "Close TDT project"); 37 putValue(LONG_DESCRIPTION, "Close Together Data Transformer project"); 38 putValue( 39 ACCELERATOR_KEY, 40 KeyStroke.getKeyStroke('E', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); 41 putValue(MNEMONIC_KEY, new Integer ('E')); 42 } 43 44 48 public void actionPerformed(ActionEvent e) { 49 if( 50 JOptionPane.showConfirmDialog(octopusProjectFrame, "Are you are sure want to close project?", "Close project", JOptionPane.INFORMATION_MESSAGE) == 0 51 ) 52 { 53 this.octopusProjectFrame.dispose(); 54 } 55 } 56 57 } 58 | Popular Tags |