0N/A/*
2362N/A * Copyright (c) 1998, 2003, 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/A
0N/Apackage sun.awt;
0N/A
0N/Aimport java.awt.Image;
0N/Aimport java.awt.Toolkit;
0N/Aimport java.awt.im.spi.InputMethod;
0N/Aimport java.awt.im.spi.InputMethodDescriptor;
0N/Aimport java.security.AccessController;
0N/Aimport java.util.Locale;
0N/Aimport sun.awt.SunToolkit;
0N/Aimport sun.security.action.GetPropertyAction;
0N/A
0N/A/**
0N/A * Provides sufficient information about an input method
0N/A * to enable selection and loading of that input method.
0N/A * The input method itself is only loaded when it is actually used.
0N/A *
0N/A * @since JDK1.3
0N/A */
0N/A
0N/Apublic abstract class X11InputMethodDescriptor implements InputMethodDescriptor {
0N/A
0N/A private static Locale locale;
0N/A
0N/A public X11InputMethodDescriptor() {
0N/A locale = getSupportedLocale();
0N/A }
0N/A
0N/A /**
0N/A * @see java.awt.im.spi.InputMethodDescriptor#getAvailableLocales
0N/A */
0N/A public Locale[] getAvailableLocales() {
0N/A Locale[] locales = {locale};
0N/A return locales;
0N/A }
0N/A
0N/A /**
0N/A * @see java.awt.im.spi.InputMethodDescriptor#hasDynamicLocaleList
0N/A */
0N/A public boolean hasDynamicLocaleList() {
0N/A return false;
0N/A }
0N/A
0N/A /**
0N/A * @see java.awt.im.spi.InputMethodDescriptor#getInputMethodDisplayName
0N/A */
0N/A public synchronized String getInputMethodDisplayName(Locale inputLocale, Locale displayLanguage) {
0N/A // We ignore the input locale.
0N/A // When displaying for the default locale, rely on the localized AWT properties;
0N/A // for any other locale, fall back to English.
0N/A String name = "System Input Methods";
0N/A if (Locale.getDefault().equals(displayLanguage)) {
0N/A name = Toolkit.getProperty("AWT.HostInputMethodDisplayName", name);
0N/A }
0N/A return name;
0N/A }
0N/A
0N/A /**
0N/A * @see java.awt.im.spi.InputMethodDescriptor#getInputMethodIcon
0N/A */
0N/A public Image getInputMethodIcon(Locale inputLocale) {
0N/A return null;
0N/A }
0N/A
0N/A /**
0N/A * @see java.awt.im.spi.InputMethodDescriptor#createInputMethod
0N/A */
0N/A public abstract InputMethod createInputMethod() throws Exception;
0N/A
0N/A /**
0N/A * returns supported locale. Currently this method returns the locale in which
0N/A * the VM is started since Solaris doesn't provide a way to determine the login locale.
0N/A */
0N/A static Locale getSupportedLocale() {
0N/A return SunToolkit.getStartupLocale();
0N/A }
0N/A}