1. /*
  2. * @(#)JobSheets.java 1.6 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.print.attribute.standard;
  8. import java.util.Locale;
  9. import javax.print.attribute.EnumSyntax;
  10. import javax.print.attribute.PrintRequestAttribute;
  11. import javax.print.attribute.PrintJobAttribute;
  12. /**
  13. * Class JobSheets is a printing attribute class, an enumeration, that
  14. * determines which job start and end sheets, if any, must be printed with a
  15. * job. Class JobSheets declares keywords for standard job sheets values.
  16. * Implementation- or site-defined names for a job sheets attribute may also be
  17. * created by defining a subclass of class JobSheets.
  18. * <P>
  19. * The effect of a JobSheets attribute on multidoc print jobs (jobs with
  20. * multiple documents) may be affected by the {@link MultipleDocumentHandling
  21. * MultipleDocumentHandling} job attribute, depending on the meaning of the
  22. * particular JobSheets value.
  23. * <P>
  24. * <B>IPP Compatibility:</B> The category name returned by
  25. * <CODE>getName()</CODE> is the IPP attribute name. The
  26. * enumeration's integer value is the IPP enum value. The
  27. * <code>toString()</code> method returns the IPP string representation of
  28. * the attribute value. For a subclass, the attribute value must be
  29. * localized to give the IPP name and natural language values.
  30. * <P>
  31. *
  32. * @author Alan Kaminsky
  33. */
  34. public class JobSheets extends EnumSyntax
  35. implements PrintRequestAttribute, PrintJobAttribute {
  36. /**
  37. * No job sheets are printed.
  38. */
  39. public static final JobSheets NONE = new JobSheets(0);
  40. /**
  41. * One or more site specific standard job sheets are printed. e.g. a
  42. * single start sheet is printed, or both start and end sheets are
  43. * printed.
  44. */
  45. public static final JobSheets STANDARD = new JobSheets(1);
  46. /**
  47. * Construct a new job sheets enumeration value with the given integer
  48. * value.
  49. *
  50. * @param value Integer value.
  51. */
  52. protected JobSheets(int value) {
  53. super (value);
  54. }
  55. private static final String[] myStringTable = {
  56. "none",
  57. "standard"
  58. };
  59. private static final JobSheets[] myEnumValueTable = {
  60. NONE,
  61. STANDARD
  62. };
  63. /**
  64. * Returns the string table for class JobSheets.
  65. */
  66. protected String[] getStringTable() {
  67. return (String[])myStringTable.clone();
  68. }
  69. /**
  70. * Returns the enumeration value table for class JobSheets.
  71. */
  72. protected EnumSyntax[] getEnumValueTable() {
  73. return (EnumSyntax[])myEnumValueTable.clone();
  74. }
  75. /**
  76. * Get the printing attribute class which is to be used as the "category"
  77. * for this printing attribute value.
  78. * <P>
  79. * For class JobSheets and any vendor-defined subclasses, the category is
  80. * class JobSheets itself.
  81. *
  82. * @return Printing attribute class (category), an instance of class
  83. * {@link java.lang.Class java.lang.Class}.
  84. */
  85. public final Class getCategory() {
  86. return JobSheets.class;
  87. }
  88. /**
  89. * Get the name of the category of which this attribute value is an
  90. * instance.
  91. * <P>
  92. * For class JobSheets and any vendor-defined subclasses, the category
  93. * name is <CODE>"job-sheets"</CODE>.
  94. *
  95. * @return Attribute category name.
  96. */
  97. public final String getName() {
  98. return "job-sheets";
  99. }
  100. }