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