Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 368439

Summary: IME & StyledText: getText() returns the input that didn't pass verifyKey/verifyText yet.
Product: [Eclipse Project] Platform Reporter: Andre Saibel <andre.saibel>
Component: SWTAssignee: Felipe Heidrich <eclipse.felipe>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: eclipse.felipe
Version: 4.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug
Attachments:
Description Flags
Snippet: StyledTextWithIME.java
none
Screen capture: StyledTextWithIME none

Description Andre Saibel CLA 2012-01-12 06:37:41 EST
Build Identifier: version 3.735

If a StyledText widget has an opened IME candidate list, the input string is also shown in the widget itself – it only can be meant to be a preview since it's not yet confirmed by the VerifyKeyListener/VerifyListener.
In this state, the StyledText's method getText() returns that (possibly invalid) input string.

PS: I didn't check it on other platforms.

Reproducible: Always

Steps to Reproduce:
1. start the snippet
2. change to a locale with IMEs (Chinese/Japanese)
3. type in something to open a candidate list
4. move the mouse over the StyledInput widget to cause getText() method call
Comment 1 Andre Saibel CLA 2012-01-12 06:38:54 EST
Created attachment 209365 [details]
Snippet: StyledTextWithIME.java
Comment 2 Andre Saibel CLA 2012-01-12 06:39:59 EST
Created attachment 209366 [details]
Screen capture: StyledTextWithIME
Comment 3 Felipe Heidrich CLA 2012-01-12 10:24:19 EST
indeed, the preedit string is in the text model during composition, and is returned by getText().
Note that when the preedit string is commit it is send for verify before being permanently insert into the text buffer.
if the composition is cancel the preedit string is removed from the buffer.

how is the current behavior causing you trouble ?
Comment 4 Lars Vogel CLA 2019-11-14 03:15:56 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.