src/share/classes/sun/print/SunPageSelection.java

Print this page




  27 
  28 import javax.print.attribute.Attribute;
  29 import javax.print.attribute.PrintRequestAttribute;
  30 
  31 /*
  32  * A class used to determine the range of pages to be printed.
  33  */
  34 @SuppressWarnings("serial") // JDK implementation class
  35 public final class SunPageSelection implements PrintRequestAttribute {
  36 
  37     public static final SunPageSelection ALL = new SunPageSelection(0);
  38     public static final SunPageSelection RANGE = new SunPageSelection(1);
  39     public static final SunPageSelection SELECTION = new SunPageSelection(2);
  40 
  41     private int pages;
  42 
  43     public SunPageSelection(int value) {
  44         pages = value;
  45     }
  46 
  47     public final Class<? extends Attribute> getCategory() {
  48         return SunPageSelection.class;
  49     }
  50 
  51     public final String getName() {
  52         return "sun-page-selection";
  53     }
  54 
  55     public String toString() {
  56        return "page-selection: " + pages;
  57     }
  58 
  59 }


  27 
  28 import javax.print.attribute.Attribute;
  29 import javax.print.attribute.PrintRequestAttribute;
  30 
  31 /*
  32  * A class used to determine the range of pages to be printed.
  33  */
  34 @SuppressWarnings("serial") // JDK implementation class
  35 public final class SunPageSelection implements PrintRequestAttribute {
  36 
  37     public static final SunPageSelection ALL = new SunPageSelection(0);
  38     public static final SunPageSelection RANGE = new SunPageSelection(1);
  39     public static final SunPageSelection SELECTION = new SunPageSelection(2);
  40 
  41     private int pages;
  42 
  43     public SunPageSelection(int value) {
  44         pages = value;
  45     }
  46 
  47     public Class<? extends Attribute> getCategory() {
  48         return SunPageSelection.class;
  49     }
  50 
  51     public String getName() {
  52         return "sun-page-selection";
  53     }
  54 
  55     public String toString() {
  56        return "page-selection: " + pages;
  57     }
  58 
  59 }