jdk/src/share/classes/javax/print/attribute/standard/DialogTypeSelection.java
author ohair
Wed, 06 Apr 2011 22:06:11 -0700
changeset 9035 1255eb81cc2f
parent 7755 3aaad496d13f
child 25093 8ec5ec01740e
permissions -rw-r--r--
7033660: Update copyright year to 2011 on any files changed in 2011 Reviewed-by: dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
9035
1255eb81cc2f 7033660: Update copyright year to 2011 on any files changed in 2011
ohair
parents: 7755
diff changeset
     2
 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.print.attribute.standard;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import javax.print.attribute.EnumSyntax;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import javax.print.attribute.PrintRequestAttribute;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * Class DialogTypeSelection is a printing attribute class, an enumeration,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * that indicates the user dialog type to be used for specifying
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * printing options.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * If {@code NATIVE} is specified, then where available, a native
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * platform dialog is displayed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * If {@code COMMON} is specified, a cross-platform print dialog is displayed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * This option to specify a native dialog for use with an IPP attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * set provides a standard way to reflect back of the setting and option
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * changes made by a user to the calling application, and integrates
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * the native dialog into the Java printing APIs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * But note that some options and settings in a native dialog may not
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * necessarily map to IPP attributes as they may be non-standard platform,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * or even printer specific options.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * <B>IPP Compatibility:</B> This is not an IPP attribute.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * @since 1.7
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
public final class DialogTypeSelection extends EnumSyntax
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
        implements PrintRequestAttribute {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
7755
3aaad496d13f 6913300: Missing serialVersionUID in javax.print.attribute.standard.DialogTypeSelection
jgodinez
parents: 5506
diff changeset
    55
    private static final long serialVersionUID = 7518682952133256029L;
3aaad496d13f 6913300: Missing serialVersionUID in javax.print.attribute.standard.DialogTypeSelection
jgodinez
parents: 5506
diff changeset
    56
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    public static final DialogTypeSelection
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
        NATIVE = new DialogTypeSelection(0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    public static final DialogTypeSelection
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        COMMON = new DialogTypeSelection(1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * Construct a new dialog type selection enumeration value with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     * given integer value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * @param  value  Integer value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    protected DialogTypeSelection(int value) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
                super(value);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    private static final String[] myStringTable = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
        "native", "common"};
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    private static final DialogTypeSelection[] myEnumValueTable = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
        NATIVE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
        COMMON
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    };
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * Returns the string table for class DialogTypeSelection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    protected String[] getStringTable() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
        return myStringTable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * Returns the enumeration value table for class DialogTypeSelection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    protected EnumSyntax[] getEnumValueTable() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        return myEnumValueTable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * Get the printing attribute class which is to be used as the "category"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     * for this printing attribute value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * For class DialogTypeSelection the category is class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     * DialogTypeSelection itself.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     * @return  Printing attribute class (category), an instance of class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     *          {@link java.lang.Class java.lang.Class}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    public final Class getCategory() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        return DialogTypeSelection.class;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * Get the name of the category of which this attribute value is an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * instance.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * For class DialogTypeSelection the category name is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     * <CODE>"dialog-type-selection"</CODE>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * @return  Attribute category name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
    public final String getName() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        return "dialog-type-selection";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
}