< prev index next >

src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java

Print this page




 539                 fileDialog.setVisible(true);
 540                 fileName = fileDialog.getFile();
 541                 if (fileName == null) {
 542                     fileDialog.dispose();
 543                     return false;
 544                 }
 545                 fullName = fileDialog.getDirectory() + fileName;
 546                 f = new File(fullName);
 547                 pFile = f.getParentFile();
 548             }
 549             fileDialog.dispose();
 550             attributes.add(new Destination(f.toURI()));
 551             return true;
 552         }
 553 
 554     }
 555 
 556     /**
 557      * Presents the user a dialog for changing properties of the
 558      * print job interactively.
 559      * @returns false if the user cancels the dialog and
 560      *          true otherwise.
 561      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
 562      * returns true.
 563      * @see java.awt.GraphicsEnvironment#isHeadless
 564      */
 565     @Override
 566     public boolean printDialog() throws HeadlessException {
 567 
 568         if (GraphicsEnvironment.isHeadless()) {
 569             throw new HeadlessException();
 570         }
 571         // current request attribute set should be reflected to the print dialog.
 572         // If null, create new instance of HashPrintRequestAttributeSet.
 573         if (attributes == null) {
 574             attributes = new HashPrintRequestAttributeSet();
 575         }
 576 
 577         if (!(getPrintService() instanceof Win32PrintService)) {
 578             return super.printDialog(attributes);
 579         }




 539                 fileDialog.setVisible(true);
 540                 fileName = fileDialog.getFile();
 541                 if (fileName == null) {
 542                     fileDialog.dispose();
 543                     return false;
 544                 }
 545                 fullName = fileDialog.getDirectory() + fileName;
 546                 f = new File(fullName);
 547                 pFile = f.getParentFile();
 548             }
 549             fileDialog.dispose();
 550             attributes.add(new Destination(f.toURI()));
 551             return true;
 552         }
 553 
 554     }
 555 
 556     /**
 557      * Presents the user a dialog for changing properties of the
 558      * print job interactively.
 559      * @return false if the user cancels the dialog and
 560      *         true otherwise.
 561      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
 562      * returns true.
 563      * @see java.awt.GraphicsEnvironment#isHeadless
 564      */
 565     @Override
 566     public boolean printDialog() throws HeadlessException {
 567 
 568         if (GraphicsEnvironment.isHeadless()) {
 569             throw new HeadlessException();
 570         }
 571         // current request attribute set should be reflected to the print dialog.
 572         // If null, create new instance of HashPrintRequestAttributeSet.
 573         if (attributes == null) {
 574             attributes = new HashPrintRequestAttributeSet();
 575         }
 576 
 577         if (!(getPrintService() instanceof Win32PrintService)) {
 578             return super.printDialog(attributes);
 579         }


< prev index next >