1 4 package org.oddjob.monitor.view; 5 6 import java.awt.event.ActionEvent ; 7 import java.io.File ; 8 9 import javax.swing.AbstractAction ; 10 import javax.swing.Action ; 11 12 import org.apache.log4j.Logger; 13 import org.oddjob.designer.OddjobDesigner; 14 import org.oddjob.monitor.OddjobExplorer; 15 import org.oddjob.monitor.Standards; 16 17 21 public class DesignerAction extends AbstractAction { 22 private static final long serialVersionUID = 0; 23 24 private static final Logger logger = Logger.getLogger(DesignerAction.class); 25 private final OddjobExplorer explorer; 26 private File config; 27 28 public DesignerAction(OddjobExplorer explorer) { 29 putValue(Action.NAME, "Oddjob Designer"); 30 this.explorer = explorer; 31 putValue(Action.MNEMONIC_KEY, Standards.DESIGNER_MNEMONIC_KEY); 32 } 33 34 public void setConfig(File file) { 35 config = file; 36 } 37 38 43 public void actionPerformed(ActionEvent e) { 44 try { 45 OddjobDesigner d = new OddjobDesigner(); 46 d.setDir(explorer.getDir()); 47 d.setFile(config); 48 d.setExplorer(explorer); 49 Thread t = new Thread (d); 50 t.start(); 51 } 52 catch (Exception ex) { 53 logger.warn("Oddjob Designer faild to launch!", ex); 54 } 55 56 } 57 } | Popular Tags |