1 19 package org.openide.actions; 20 21 import org.openide.text.PrintSettings; 22 import org.openide.util.HelpCtx; 23 import org.openide.util.NbBundle; 24 import org.openide.util.actions.CallableSystemAction; 25 26 import java.awt.print.PrinterJob ; 27 28 29 31 public final class PageSetupAction extends CallableSystemAction { 32 public PageSetupAction() { 33 putValue("noIconInMenu", Boolean.TRUE); } 35 36 public synchronized void performAction() { 37 PrintSettings ps = (PrintSettings) PrintSettings.findObject(PrintSettings.class, true); 38 PrinterJob pj = PrinterJob.getPrinterJob(); 39 ps.setPageFormat(pj.pageDialog(PrintSettings.getPageFormat(pj))); 40 } 41 42 protected boolean asynchronous() { 43 return false; 44 } 45 46 public String getName() { 47 return NbBundle.getMessage(PageSetupAction.class, "PageSetup"); 48 } 49 50 public HelpCtx getHelpCtx() { 51 return new HelpCtx(PageSetupAction.class); 52 } 53 } 54 | Popular Tags |