1 33 34 package edu.rice.cs.drjava.ui; 35 36 import java.awt.print.*; 37 38 import edu.rice.cs.drjava.model.*; 39 40 import edu.rice.cs.util.text.EditDocumentInterface; 41 42 45 public class PreviewConsoleFrame extends PreviewFrame { 46 47 private volatile EditDocumentInterface _document; 48 49 52 public PreviewConsoleFrame(SingleDisplayModel model, MainFrame mainFrame, boolean interactions) 53 throws IllegalStateException { 54 super(model, mainFrame, interactions); 55 } 56 57 58 63 protected Pageable setUpDocument(SingleDisplayModel model, boolean interactions) { 64 if (interactions) _document = model.getInteractionsDocument(); 65 else _document = model.getConsoleDocument(); 66 return _document.getPageable(); 67 } 68 69 protected void _print() { 70 try { _document.print(); } 71 catch (PrinterException e) { _showError(e, "Print Error", "An error occured while printing."); } 72 } 73 } | Popular Tags |