1 33 34 package edu.rice.cs.drjava.ui; 35 36 import javax.swing.text.*; 37 import java.awt.print.*; 38 import edu.rice.cs.drjava.model.*; 39 40 44 public class PreviewDefDocFrame extends PreviewFrame { 45 46 private OpenDefinitionsDocument _document; 47 48 51 public PreviewDefDocFrame(SingleDisplayModel model, MainFrame mainFrame) throws IllegalStateException { 52 super(model, mainFrame, false); 53 } 54 55 62 protected Pageable setUpDocument(SingleDisplayModel model, boolean notUsed) { 63 _document = model.getActiveDocument(); 64 return _document.getPageable(); 65 } 66 67 68 protected void _print() { 69 try { 70 _document.print(); 71 } 72 catch (FileMovedException fme) { 73 _mainFrame._showFileMovedError(fme); 74 } 75 catch (PrinterException e) { 76 _showError(e, "Print Error", "An error occured while printing."); 77 } 78 catch (BadLocationException e) { 79 _showError(e, "Print Error", "An error occured while printing."); 80 } 81 } 82 } | Popular Tags |