src/share/classes/java/awt/im/spi/InputMethodDescriptor.java

Print this page


   1 /*
   2  * Copyright (c) 1998, 1999, Oracle and/or its affiliates. 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.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  55      * be returned. Thus, the list of locales returned is typically
  56      * a subset of the locales for which the corresponding input method's
  57      * implementation of {@link java.awt.im.spi.InputMethod#setLocale} returns true.
  58      * <p>
  59      * If {@link #hasDynamicLocaleList} returns true, this method is
  60      * called each time the information is needed. This
  61      * gives input methods that depend on network resources the chance
  62      * to add or remove locales as resources become available or
  63      * unavailable.
  64      *
  65      * @return the locales supported by the input method
  66      * @exception AWTException if it can be determined that the input method
  67      * is inoperable, for example, because of incomplete installation.
  68      */
  69     Locale[] getAvailableLocales() throws AWTException;
  70 
  71     /**
  72      * Returns whether the list of available locales can change
  73      * at runtime. This may be the case, for example, for adapters
  74      * that access real input methods over the network.


  75      */
  76     boolean hasDynamicLocaleList();
  77 
  78     /**
  79      * Returns the user-visible name of the corresponding
  80      * input method for the given input locale in the language in which
  81      * the name will be displayed.
  82      * <p>
  83      * The inputLocale parameter specifies the locale for which text
  84      * is input.
  85      * This parameter can only take values obtained from this descriptor's
  86      * {@link #getAvailableLocales} method or null. If it is null, an
  87      * input locale independent name for the input method should be
  88      * returned.
  89      * <p>
  90      * If a name for the desired display language is not available, the
  91      * method may fall back to some other language.
  92      *
  93      * @param inputLocale the locale for which text input is supported, or null
  94      * @param displayLanguage the language in which the name will be displayed



  95      */
  96     String getInputMethodDisplayName(Locale inputLocale, Locale displayLanguage);
  97 
  98     /**
  99      * Returns an icon for the corresponding input method.
 100      * The icon may be used by a user interface for selecting input methods.
 101      * <p>
 102      * The inputLocale parameter specifies the locale for which text
 103      * is input.
 104      * This parameter can only take values obtained from this descriptor's
 105      * {@link #getAvailableLocales} method or null. If it is null, an
 106      * input locale independent icon for the input method should be
 107      * returned.
 108      * <p>
 109      * The icon's size should be 16&times;16 pixels.
 110      *
 111      * @param inputLocale the locale for which text input is supported, or null
 112      * @return an icon for the corresponding input method, or null
 113      */
 114     Image getInputMethodIcon(Locale inputLocale);
   1 /*
   2  * Copyright (c) 1998, 2014, Oracle and/or its affiliates. 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.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  55      * be returned. Thus, the list of locales returned is typically
  56      * a subset of the locales for which the corresponding input method's
  57      * implementation of {@link java.awt.im.spi.InputMethod#setLocale} returns true.
  58      * <p>
  59      * If {@link #hasDynamicLocaleList} returns true, this method is
  60      * called each time the information is needed. This
  61      * gives input methods that depend on network resources the chance
  62      * to add or remove locales as resources become available or
  63      * unavailable.
  64      *
  65      * @return the locales supported by the input method
  66      * @exception AWTException if it can be determined that the input method
  67      * is inoperable, for example, because of incomplete installation.
  68      */
  69     Locale[] getAvailableLocales() throws AWTException;
  70 
  71     /**
  72      * Returns whether the list of available locales can change
  73      * at runtime. This may be the case, for example, for adapters
  74      * that access real input methods over the network.
  75      * @return whether the list of available locales can change at
  76      * runtime
  77      */
  78     boolean hasDynamicLocaleList();
  79 
  80     /**
  81      * Returns the user-visible name of the corresponding
  82      * input method for the given input locale in the language in which
  83      * the name will be displayed.
  84      * <p>
  85      * The inputLocale parameter specifies the locale for which text
  86      * is input.
  87      * This parameter can only take values obtained from this descriptor's
  88      * {@link #getAvailableLocales} method or null. If it is null, an
  89      * input locale independent name for the input method should be
  90      * returned.
  91      * <p>
  92      * If a name for the desired display language is not available, the
  93      * method may fall back to some other language.
  94      *
  95      * @param inputLocale the locale for which text input is supported, or null
  96      * @param displayLanguage the language in which the name will be displayed
  97      * @return the user-visible name of the corresponding input method
  98      * for the given input locale in the language in which the name
  99      * will be displayed
 100      */
 101     String getInputMethodDisplayName(Locale inputLocale, Locale displayLanguage);
 102 
 103     /**
 104      * Returns an icon for the corresponding input method.
 105      * The icon may be used by a user interface for selecting input methods.
 106      * <p>
 107      * The inputLocale parameter specifies the locale for which text
 108      * is input.
 109      * This parameter can only take values obtained from this descriptor's
 110      * {@link #getAvailableLocales} method or null. If it is null, an
 111      * input locale independent icon for the input method should be
 112      * returned.
 113      * <p>
 114      * The icon's size should be 16&times;16 pixels.
 115      *
 116      * @param inputLocale the locale for which text input is supported, or null
 117      * @return an icon for the corresponding input method, or null
 118      */
 119     Image getInputMethodIcon(Locale inputLocale);