Name: dsR10051 Date: 04/18/2001
Method
public void java.awt.im.InputContext.setCompositionEnabled(boolean)
works incorrectly under Win32 platform. When the value of
parameter is true, it neither enables the current input method for composition
nor throws UnsupportedOperationException.
The documentation for this method says:
/**
* Enables or disables the current input method for composition,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* depending on the value of the parameter <code>enable</code>.
* <p>
* An input method that is enabled for composition interprets incoming
* events for both composition and control purposes, while a
* disabled input method does not interpret events for composition.
* Note however that events are passed on to the input method regardless
* whether it is enabled or not, and that an input method that is disabled
* for composition may still interpret events for control purposes,
* including to enable or disable itself for composition.
*
* @param enable whether to enable the current input method for composition
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* @throws UnsupportedOperationException if there is no current input
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* method available or the current input method does not support
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* the enabling/disabling operation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* @see #isCompositionEnabled
^^^^^^^^^^^^^^^^^^^^^^^^^^
* @since 1.3
*/
public void setCompositionEnabled(boolean enable) {
Here is minimized test:
import java.awt.im.*;
public class InputMethodTest01 {
public static void main(String args[]) {
InputContext ic = InputContext.getInstance();
try {
ic.setCompositionEnabled(true);
if (!ic.isCompositionEnabled()) {
System.out.println("FAILED, CompositionEnabled is false, should be true");
System.exit(1);
}
ic.setCompositionEnabled(false);
if (!ic.isCompositionEnabled()) {
System.out.println("FAILED, CompositionEnabled is true, should be false");
System.exit(1);
}
} catch (UnsupportedOperationException uoe) {
System.out.println(uoe);
}
System.out.println("OKAY");
}
}
--- Output ---
M:\bin>J:\JDK1.4.0beta-b60\win32\bin\java -version
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b60)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b60, mixed mode)
M:\bin>J:\JDK1.4.0beta-b60\win32\bin\java InputMethodTest01
FAILED, CompositionEnabled is false, should be true
======================================================================
Method
public void java.awt.im.InputContext.setCompositionEnabled(boolean)
works incorrectly under Win32 platform. When the value of
parameter is true, it neither enables the current input method for composition
nor throws UnsupportedOperationException.
The documentation for this method says:
/**
* Enables or disables the current input method for composition,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* depending on the value of the parameter <code>enable</code>.
* <p>
* An input method that is enabled for composition interprets incoming
* events for both composition and control purposes, while a
* disabled input method does not interpret events for composition.
* Note however that events are passed on to the input method regardless
* whether it is enabled or not, and that an input method that is disabled
* for composition may still interpret events for control purposes,
* including to enable or disable itself for composition.
*
* @param enable whether to enable the current input method for composition
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* @throws UnsupportedOperationException if there is no current input
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* method available or the current input method does not support
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* the enabling/disabling operation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* @see #isCompositionEnabled
^^^^^^^^^^^^^^^^^^^^^^^^^^
* @since 1.3
*/
public void setCompositionEnabled(boolean enable) {
Here is minimized test:
import java.awt.im.*;
public class InputMethodTest01 {
public static void main(String args[]) {
InputContext ic = InputContext.getInstance();
try {
ic.setCompositionEnabled(true);
if (!ic.isCompositionEnabled()) {
System.out.println("FAILED, CompositionEnabled is false, should be true");
System.exit(1);
}
ic.setCompositionEnabled(false);
if (!ic.isCompositionEnabled()) {
System.out.println("FAILED, CompositionEnabled is true, should be false");
System.exit(1);
}
} catch (UnsupportedOperationException uoe) {
System.out.println(uoe);
}
System.out.println("OKAY");
}
}
--- Output ---
M:\bin>J:\JDK1.4.0beta-b60\win32\bin\java -version
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b60)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b60, mixed mode)
M:\bin>J:\JDK1.4.0beta-b60\win32\bin\java InputMethodTest01
FAILED, CompositionEnabled is false, should be true
======================================================================
- relates to
-
JDK-4286959 Win32: setCompositionEnabled and isCompositionEnabled do not throw exception
-
- Closed
-