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.KeyStroke ; 12 13 18 public class StartOctopusLoaderAction extends AbstractAction { 19 20 OctopusProjectFrame octopusProjectFrame; 21 22 25 public StartOctopusLoaderAction(OctopusProjectFrame octopusProjectFrame, String label) { 26 27 this.octopusProjectFrame = octopusProjectFrame; 28 putValue(NAME, label); 29 putValue( 30 SMALL_ICON, 31 new ImageIcon ( 32 getClass().getClassLoader().getResource( 33 "org/webdocwf/util/loader/" + "wizard/images/StartLoader.gif"))); 35 putValue(SHORT_DESCRIPTION, "Start the OctopusLoader application"); 36 putValue(LONG_DESCRIPTION, "Start the OctopusLoader application"); 37 putValue( 38 ACCELERATOR_KEY, 39 KeyStroke.getKeyStroke('L', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); 40 putValue(MNEMONIC_KEY, new Integer ('L')); 41 } 42 43 47 public void actionPerformed(ActionEvent e) { 48 OctopusLoaderData initData = null; 49 String errorMsg = null; 50 try { 51 octopusProjectFrame.setActiveTab(1); 52 initData = octopusProjectFrame.getLoaderPanel().getOctopusLoaderInit(); 53 } catch (Exception ex) { 54 ex.printStackTrace(); 55 errorMsg = ex.getMessage(); 56 } 57 octopusProjectFrame.getLoaderPanel().getTraceArea().setText(""); 58 OctopusLoaderThread runOctopus = new OctopusLoaderThread( 59 initData, 60 errorMsg, 61 octopusProjectFrame.getLoaderPanel().getTraceArea()); 62 runOctopus.start(); 63 } 64 65 } 66 | Popular Tags |