View Javadoc
1 // $Id: PrintCenter.java,v 1.1 2004/02/12 22:38:15 powerpete Exp $ 2 // [JMP, 12.02.2004] Created this file. 3 package org.jface.stepmt.demoapp.print; 4 5 import java.awt.print.Pageable; 6 import java.awt.print.PrinterException; 7 import java.awt.print.PrinterJob; 8 9 import org.jface.stepmt.transform.PrinterPipeline; 10 import org.jface.stepmt.transform.config.PipelineTemplate; 11 import org.xml.sax.SAXException; 12 13 /*** 14 * @author <a href="mailto:powerpete@users.sf.net">M. Petersen</a> 15 * @version $Id: PrintCenter.java,v 1.1 2004/02/12 22:38:15 powerpete Exp $ 16 */ 17 public class PrintCenter 18 { 19 public void print(PipelineTemplate template, String text) 20 throws SAXException, PrinterException 21 { 22 PrinterPipeline pipeline = template.getPrinterPipeline(); 23 pipeline.generate(template.getRegion(), text); 24 Pageable pageable = pipeline.getPageable(); 25 PrinterJob printerJob = PrinterJob.getPrinterJob(); 26 printerJob.setPageable(pageable); 27 if (printerJob.printDialog()) 28 { 29 printerJob.print(); 30 } 31 } 32 }

This page was automatically generated by Maven