View Javadoc
1 package jface.fodevelop; 2 3 import java.awt.FileDialog; 4 import java.awt.event.ActionEvent; 5 import java.io.IOException; 6 7 import jface.vega.ActionFacade; 8 import jface.vega.WindowManager; 9 10 import org.apache.commons.logging.LogFactory; 11 12 /*** 13 * @author <a href="mailto:powerpete@users.sf.net">Moritz Petersen</a> 14 * @version $Id: ExportFoAction.java,v 1.1 2003/07/13 17:26:12 powerpete Exp $ 15 */ 16 public class ExportFoAction extends ActionFacade 17 { 18 public void actionPerformed(ActionEvent e) 19 { 20 PreviewFrame frame = (PreviewFrame) WindowManager.getInstance().getForegroundWindow(); 21 PreviewData data = frame.getPreviewData(); 22 String file = frame.showFileDialog(data.getFoFilename(), FileDialog.SAVE); 23 if (file == null) 24 { 25 return; 26 } 27 data.setFoFilename(file); 28 try 29 { 30 new FileWriter(file).write(data.getGeneratedFo().getBytes()); 31 } 32 catch (IOException e1) 33 { 34 LogFactory.getLog(ExportFoAction.class).fatal("Error while exporting fo."); 35 } 36 } 37 38 }

This page was automatically generated by Maven