blob: 474d86cf22161b7800764bab675bed4e433d9b00 [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001/*
2 * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Sun designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Sun in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25
26package javax.print.attribute.standard;
27
28import javax.print.attribute.EnumSyntax;
29import javax.print.attribute.PrintRequestAttribute;
30
31/**
32 * Class DialogTypeSelection is a printing attribute class, an enumeration,
33 * that indicates the user dialog type to be used for specifying
34 * printing options.
35 * If {@code NATIVE} is specified, then where available, a native
36 * platform dialog is displayed.
37 * If {@code COMMON} is specified, a cross-platform print dialog is displayed.
38 *
39 * This option to specify a native dialog for use with an IPP attribute
40 * set provides a standard way to reflect back of the setting and option
41 * changes made by a user to the calling application, and integrates
42 * the native dialog into the Java printing APIs.
43 * But note that some options and settings in a native dialog may not
44 * necessarily map to IPP attributes as they may be non-standard platform,
45 * or even printer specific options.
46 * <P>
47 * <B>IPP Compatibility:</B> This is not an IPP attribute.
48 * <P>
49 * @since 1.7
50 *
51 */
52public final class DialogTypeSelection extends EnumSyntax
53 implements PrintRequestAttribute {
54
55 /**
56 *
57 */
58 public static final DialogTypeSelection
59 NATIVE = new DialogTypeSelection(0);
60
61 /**
62 *
63 */
64 public static final DialogTypeSelection
65 COMMON = new DialogTypeSelection(1);
66
67 /**
68 * Construct a new dialog type selection enumeration value with the
69 * given integer value.
70 *
71 * @param value Integer value.
72 */
73 protected DialogTypeSelection(int value) {
74 super(value);
75 }
76
77 private static final String[] myStringTable = {
78 "native", "common"};
79
80
81 private static final DialogTypeSelection[] myEnumValueTable = {
82 NATIVE,
83 COMMON
84 };
85
86 /**
87 * Returns the string table for class DialogTypeSelection.
88 */
89 protected String[] getStringTable() {
90 return myStringTable;
91 }
92
93 /**
94 * Returns the enumeration value table for class DialogTypeSelection.
95 */
96 protected EnumSyntax[] getEnumValueTable() {
97 return myEnumValueTable;
98 }
99
100
101 /**
102 * Get the printing attribute class which is to be used as the "category"
103 * for this printing attribute value.
104 * <P>
105 * For class DialogTypeSelection the category is class
106 * DialogTypeSelection itself.
107 *
108 * @return Printing attribute class (category), an instance of class
109 * {@link java.lang.Class java.lang.Class}.
110 */
111 public final Class getCategory() {
112 return DialogTypeSelection.class;
113 }
114
115
116 /**
117 * Get the name of the category of which this attribute value is an
118 * instance.
119 * <P>
120 * For class DialogTypeSelection the category name is
121 * <CODE>"dialog-type-selection"</CODE>.
122 *
123 * @return Attribute category name.
124 */
125 public final String getName() {
126 return "dialog-type-selection";
127 }
128
129}