-
Enhancement
-
Resolution: Unresolved
-
P3
-
8, 9, 10
-
generic
-
generic
The 'replacement range' is the range in the committed document text which should be replaced with the InputMethod composed text.
This feature exists in the MacOS Cocoa IM API and is used for press-and-hold input:
e.g. when the 'e' key is pressed and hold for some time the input method is activated to select a accented variant. In this case Cocoa sends the regular keyDown event for 'e' character, and then setMarkedText event which has a Replacement parameter containing the NSRange of the last entered character (which should be replaced).
The root problem is that 'replacement range' can't be delivered to the custom text components (seeJDK-8073194 for details).
This feature can be useful independently of the underlying platform as well. For example IM with auto-completion feature when IM aims to replace already entered text part.
The proposed API changes are below:
Add two int fields to the InputMethodEvent: replaceStartPos, replaceEndPos + according constructor(s) and getters
Add to the java.awt.im.spi.InputMethodContext interface the method dispatchInputMethodEvent with the corresponding 2 arguments.
The latter interface change is optional for the purpose of using the native IMs, but is required for implementing Java IMs with the 'replacement range' feature.
This feature exists in the MacOS Cocoa IM API and is used for press-and-hold input:
e.g. when the 'e' key is pressed and hold for some time the input method is activated to select a accented variant. In this case Cocoa sends the regular keyDown event for 'e' character, and then setMarkedText event which has a Replacement parameter containing the NSRange of the last entered character (which should be replaced).
The root problem is that 'replacement range' can't be delivered to the custom text components (see
This feature can be useful independently of the underlying platform as well. For example IM with auto-completion feature when IM aims to replace already entered text part.
The proposed API changes are below:
Add two int fields to the InputMethodEvent: replaceStartPos, replaceEndPos + according constructor(s) and getters
Add to the java.awt.im.spi.InputMethodContext interface the method dispatchInputMethodEvent with the corresponding 2 arguments.
The latter interface change is optional for the purpose of using the native IMs, but is required for implementing Java IMs with the 'replacement range' feature.
- relates to
-
JDK-8073194 [macosx] Accented Character Input Needs to be Supported in JComponent API
- Closed