public abstract class ServiceUIFactory extends Object
虽然Print Service API目前不提供管理打印服务的标准化支持,但是可以监视打印服务,并且UI可以提供私有更新机制。
基本的设计意图是允许应用程序在需要的时候只需在没有任何API依赖关系的情况下,才能轻松地定位和初始化服务,除非在使用它们的环境中。
Swing UI是首选,因为它们提供更一致的L&F,并且可以支持可访问性API。
使用示例
  ServiceUIFactory factory = printService.getServiceUIFactory();
  if (factory != null) {
      JComponent swingui = (JComponent)factory.getUI(
                                         ServiceUIFactory.MAIN_UIROLE,
                                         ServiceUIFactory.JCOMPONENT_UI);
      if (swingui != null) {
          tabbedpane.add("Custom UI", swingui);
      }
  }  
      | Modifier and Type | Field and Description | 
|---|---|
| static int | ABOUT_UIROLE
              表示执行信息丰富的“关于”角色的UI。 
             | 
| static int | ADMIN_UIROLE
              表示执行管理角色的UI。 
             | 
| static String | DIALOG_UI
              表示实现为AWT对话框的UI。 
             | 
| static String | JCOMPONENT_UI
              表示实现为Swing组件的UI。 
             | 
| static String | JDIALOG_UI
              表示实现为Swing对话框的UI。 
             | 
| static int | MAIN_UIROLE
              表示执行正常最终用户角色的UI。 
             | 
| static String | PANEL_UI
              表示作为AWT面板实现的UI。 
             | 
| static int | RESERVED_UIROLE
              不是有效的角色,但角色ID大于此可能用于服务支持的私有角色。 
             | 
| Constructor and Description | 
|---|
| ServiceUIFactory() | 
public static final String JCOMPONENT_UI
public static final String PANEL_UI
public static final String DIALOG_UI
public static final String JDIALOG_UI
public static final int ABOUT_UIROLE
public static final int ADMIN_UIROLE
public static final int MAIN_UIROLE
public static final int RESERVED_UIROLE
public abstract Object getUI(int role, String ui)
role - 已请求。 
            必须是此工厂支持的标准角色或私人角色之一。 
           ui - 
            ui角色的类型。 
           IllegalArgumentException - 如果角色或者用户既不是标准的,也不是工厂支持的私有的。 
           public abstract String[] getUIClassNamesForRole(int role)
role - 要查找。 
           IllegalArgumentException - 作用是这个工厂不支持的非标准角色。 
            Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.