0N/A/*
2362N/A * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage javax.print;
0N/A
0N/A/**
0N/A * Services may optionally provide UIs which allow different styles
0N/A * of interaction in different roles.
0N/A * One role may be end-user browsing and setting of print options.
0N/A * Another role may be administering the print service.
0N/A * <p>
0N/A * Although the Print Service API does not presently provide standardised
0N/A * support for administering a print service, monitoring of the print
0N/A * service is possible and a UI may provide for private update mechanisms.
0N/A * <p>
0N/A * The basic design intent is to allow applications to lazily locate and
0N/A * initialize services only when needed without any API dependencies
0N/A * except in an environment in which they are used.
0N/A * <p>
0N/A * Swing UIs are preferred as they provide a more consistent L&F and
0N/A * can support accessibility APIs.
0N/A * <p>
0N/A * Example usage:
0N/A * <pre>
0N/A * ServiceUIFactory factory = printService.getServiceUIFactory();
0N/A * if (factory != null) {
0N/A * JComponent swingui = (JComponent)factory.getUI(
0N/A * ServiceUIFactory.MAIN_UIROLE,
0N/A * ServiceUIFactory.JCOMPONENT_UI);
0N/A * if (swingui != null) {
0N/A * tabbedpane.add("Custom UI", swingui);
0N/A * }
0N/A * }
0N/A * </pre>
0N/A */
0N/A
0N/Apublic abstract class ServiceUIFactory {
0N/A
0N/A /**
0N/A * Denotes a UI implemented as a Swing component.
0N/A * The value of the String is the fully qualified classname :
0N/A * "javax.swing.JComponent".
0N/A */
0N/A public static final String JCOMPONENT_UI = "javax.swing.JComponent";
0N/A
0N/A /**
0N/A * Denotes a UI implemented as an AWT panel.
0N/A * The value of the String is the fully qualified classname :
0N/A * "java.awt.Panel"
0N/A */
0N/A public static final String PANEL_UI = "java.awt.Panel";
0N/A
0N/A /**
0N/A * Denotes a UI implemented as an AWT dialog.
0N/A * The value of the String is the fully qualified classname :
0N/A * "java.awt.Dialog"
0N/A */
0N/A public static final String DIALOG_UI = "java.awt.Dialog";
0N/A
0N/A /**
0N/A * Denotes a UI implemented as a Swing dialog.
0N/A * The value of the String is the fully qualified classname :
0N/A * "javax.swing.JDialog"
0N/A */
0N/A public static final String JDIALOG_UI = "javax.swing.JDialog";
0N/A
0N/A /**
0N/A * Denotes a UI which performs an informative "About" role.
0N/A */
0N/A public static final int ABOUT_UIROLE = 1;
0N/A
0N/A /**
0N/A * Denotes a UI which performs an administrative role.
0N/A */
0N/A public static final int ADMIN_UIROLE = 2;
0N/A
0N/A /**
0N/A * Denotes a UI which performs the normal end user role.
0N/A */
0N/A public static final int MAIN_UIROLE = 3;
0N/A
0N/A /**
0N/A * Not a valid role but role id's greater than this may be used
0N/A * for private roles supported by a service. Knowledge of the
0N/A * function performed by this role is required to make proper use
0N/A * of it.
0N/A */
0N/A public static final int RESERVED_UIROLE = 99;
0N/A /**
0N/A * Get a UI object which may be cast to the requested UI type
0N/A * by the application and used in its user interface.
0N/A * <P>
0N/A * @param role requested. Must be one of the standard roles or
0N/A * a private role supported by this factory.
0N/A * @param ui type in which the role is requested.
0N/A * @return the UI role or null if the requested UI role is not available
0N/A * from this factory
0N/A * @throws IllegalArgumentException if the role or ui is neither
0N/A * one of the standard ones, nor a private one
0N/A * supported by the factory.
0N/A */
0N/A public abstract Object getUI(int role, String ui) ;
0N/A
0N/A /**
0N/A * Given a UI role obtained from this factory obtain the UI
0N/A * types available from this factory which implement this role.
0N/A * The returned Strings should refer to the static variables defined
0N/A * in this class so that applications can use equality of reference
0N/A * ("==").
0N/A * @param role to be looked up.
0N/A * @return the UI types supported by this class for the specified role,
0N/A * null if no UIs are available for the role.
0N/A * @throws IllegalArgumentException is the role is a non-standard
0N/A * role not supported by this factory.
0N/A */
0N/A public abstract String[] getUIClassNamesForRole(int role) ;
0N/A
0N/A
0N/A
0N/A}