1 /*
2 * Copyright (c) 1997, 2008, 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
70 * @see java.awt.Component#getInputContext
71 * @see java.awt.Component#enableInputMethods
72 * @author JavaSoft Asia/Pacific
73 * @since 1.2
74 */
75
76 public class InputContext {
77
78 /**
79 * Constructs an InputContext.
80 * This method is protected so clients cannot instantiate
81 * InputContext directly. Input contexts are obtained by
82 * calling {@link #getInstance}.
83 */
84 protected InputContext() {
85 // real implementation is in sun.awt.im.InputContext
86 }
87
88 /**
89 * Returns a new InputContext instance.
90 */
91 public static InputContext getInstance() {
92 return new sun.awt.im.InputMethodContext();
93 }
94
95 /**
96 * Attempts to select an input method or keyboard layout that
97 * supports the given locale, and returns a value indicating whether such
98 * an input method or keyboard layout has been successfully selected. The
99 * following steps are taken until an input method has been selected:
100 *
101 * <ul>
102 * <li>
103 * If the currently selected input method or keyboard layout supports the
104 * requested locale, it remains selected.</li>
105 *
106 * <li>
107 * If there is no input method or keyboard layout available that supports
108 * the requested locale, the current input method or keyboard layout remains
109 * selected.</li>
|
1 /*
2 * Copyright (c) 1997, 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
70 * @see java.awt.Component#getInputContext
71 * @see java.awt.Component#enableInputMethods
72 * @author JavaSoft Asia/Pacific
73 * @since 1.2
74 */
75
76 public class InputContext {
77
78 /**
79 * Constructs an InputContext.
80 * This method is protected so clients cannot instantiate
81 * InputContext directly. Input contexts are obtained by
82 * calling {@link #getInstance}.
83 */
84 protected InputContext() {
85 // real implementation is in sun.awt.im.InputContext
86 }
87
88 /**
89 * Returns a new InputContext instance.
90 * @return a new InputContext instance
91 */
92 public static InputContext getInstance() {
93 return new sun.awt.im.InputMethodContext();
94 }
95
96 /**
97 * Attempts to select an input method or keyboard layout that
98 * supports the given locale, and returns a value indicating whether such
99 * an input method or keyboard layout has been successfully selected. The
100 * following steps are taken until an input method has been selected:
101 *
102 * <ul>
103 * <li>
104 * If the currently selected input method or keyboard layout supports the
105 * requested locale, it remains selected.</li>
106 *
107 * <li>
108 * If there is no input method or keyboard layout available that supports
109 * the requested locale, the current input method or keyboard layout remains
110 * selected.</li>
|