MCPcopy
hub / github.com/arduino/Arduino / handlePrint

Method handlePrint

app/src/processing/app/Editor.java:2477–2503  ·  view source on GitHub ↗

Handler for File → Print.

()

Source from the content-addressed store, hash-verified

2475 * Handler for File → Print.
2476 */
2477 private void handlePrint() {
2478 statusNotice(tr("Printing..."));
2479 //printerJob = null;
2480 PrinterJob printerJob = PrinterJob.getPrinterJob();
2481 if (pageFormat != null) {
2482 //System.out.println("setting page format " + pageFormat);
2483 printerJob.setPrintable(getCurrentTab().getTextArea(), pageFormat);
2484 } else {
2485 printerJob.setPrintable(getCurrentTab().getTextArea());
2486 }
2487 // set the name of the job to the code name
2488 printerJob.setJobName(getCurrentTab().getSketchFile().getPrettyName());
2489
2490 if (printerJob.printDialog()) {
2491 try {
2492 printerJob.print();
2493 statusNotice(tr("Done printing."));
2494
2495 } catch (PrinterException pe) {
2496 statusError(tr("Error while printing."));
2497 pe.printStackTrace();
2498 }
2499 } else {
2500 statusNotice(tr("Printing canceled."));
2501 }
2502 //printerJob = null; // clear this out?
2503 }
2504
2505
2506 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Callers 1

buildFileMenuMethod · 0.95

Calls 8

statusNoticeMethod · 0.95
getCurrentTabMethod · 0.95
statusErrorMethod · 0.95
trMethod · 0.80
getTextAreaMethod · 0.80
getPrettyNameMethod · 0.80
getSketchFileMethod · 0.80
printStackTraceMethod · 0.80

Tested by

no test coverage detected