use of com.att.aro.ui.commonui.AROPrintablePanel in project VideoOptimzer by attdevsupport.
the class AROFileMenu method handlePrint.
private void handlePrint() {
final JComponent currentTabComponent = (JComponent) parent.getCurrentTabComponent();
if (currentTabComponent instanceof IAROPrintable) {
final IAROPrintable aroPrintable = (IAROPrintable) currentTabComponent;
final PrinterJob printJob = PrinterJob.getPrinterJob();
if (printJob.printDialog()) {
new Thread(new Runnable() {
@Override
public void run() {
Thread.setDefaultUncaughtExceptionHandler(new CrashHandler());
printJob.setPrintable(new AROPrintablePanel(aroPrintable.getPrintablePanel()));
try {
printJob.print();
} catch (PrinterException e) {
String[] messageWrapper = new String[1];
messageWrapper[0] = e.getLocalizedMessage();
new MessageDialogFactory().showErrorDialog(null, tabPanelCommon.getText(MenuItem.error_printer, messageWrapper));
}
}
}).start();
}
} else {
throw new AROUIIllegalStateException(tabPanelCommon.getText(MenuItem.error_printer_notprintable));
}
}
Aggregations