Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352863 - [Text] programmaticaly selection doesn't works correctly (only IE)
Summary: [Text] programmaticaly selection doesn't works correctly (only IE)
Status: CLOSED WONTFIX
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-22 09:52 EDT by Serge Démoulin CLA
Modified: 2014-08-07 05:03 EDT (History)
1 user (show)

See Also:


Attachments
example class (2.89 KB, application/octet-stream)
2011-07-22 09:55 EDT, Serge Démoulin CLA
no flags Details
Patch to reproduce in controls demo (861 bytes, patch)
2013-06-21 08:44 EDT, Alexander Becher CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Serge Démoulin CLA 2011-07-22 09:52:12 EDT
Build Identifier: 

I tried to make a graphical light List.
The component behaves like a List but is in fact a multiline Text (see attachement). If the user click inside a line then the entire line will be selected. 
In some case (probabily because of the german special characters) the selection doesn't works correctly : the line is not entirely selected or another line is selected. See the following example :

CONTENT =
aaaa
bbbb
cccc
ddd dd [ERF]
eeee
ff ff
äöpödso2sdsdsd sdsdsdsdsdsdsd
äöppsdsödkmsopierjkw pewü
abgv

behaviour :
If I click on the first to the 7. line the entiry line is selected (see Remark 2).
If I click on the 8. or the 9. line only "äöppsdsödkmsopierjkw pew" is selected.

Remark:
1. under Firefox it works fine. 
2. under IE I have to consider that "\n" takes 2 places !

Reproducible: Always
Comment 1 Serge Démoulin CLA 2011-07-22 09:55:31 EDT
Created attachment 200187 [details]
example class
Comment 2 Ivan Furnadjiev CLA 2011-07-22 11:13:36 EDT
Serge, without looking in deep in your code, I want to let you know that widget subclassing is illegal in SWT (will be illegal in RAP too - see bug 333272 ). The Text widget JavaDoc states that: "IMPORTANT: This class is *not* intended to be subclassed."
Comment 3 Serge Démoulin CLA 2011-07-22 15:53:45 EDT
I k(In reply to comment #2)
> Serge, without looking in deep in your code, I want to let you know that widget
> subclassing is illegal in SWT (will be illegal in RAP too - see bug 333272 ).
> The Text widget JavaDoc states that: "IMPORTANT: This class is *not* intended
> to be subclassed."

I know but it is only a quick&dirty test class and since I'm not overriding any method I guess it doesn't matter. It is not the cause of the problem.
Comment 4 Ivan Furnadjiev CLA 2011-07-28 09:06:12 EDT
I can reproduce it with your snippet, but currently I have no idea what is the reason for this weird behavior.
Comment 5 Serge Démoulin CLA 2011-08-16 07:00:57 EDT
(In reply to comment #4)
> I can reproduce it with your snippet, but currently I have no idea what is the
> reason for this weird behavior.

I guess the first cause is that this special characters are coded on 2 bytes instead of 1 byte.
Comment 6 Ivan Furnadjiev CLA 2012-04-09 05:04:11 EDT
This is not an issue in IE9 (standard rendering), but I still can reproduce the problem with IE8 (1.5M6).
Comment 7 Alexander Becher CLA 2013-06-21 08:44:54 EDT
Created attachment 232639 [details]
Patch to reproduce in controls demo

I've added a patch to reproduce the problem in the controls demo (text tab).

The error occurs when you enter multi-line text with style MULTI enabled.
If you select something in the first line e.g. from 1 to 2, the text widget selects from 0 to 1.
If you do the same using the mouse and then leave the textfield by pressing TAB and then reenter the textfield by pressing SHIFT-TAB the selection shifts one character to the left

This is reproducible on version 2.0 and 2.1 with IE8 but not IE9.
Comment 8 Ivan Furnadjiev CLA 2014-08-07 05:03:57 EDT
The IE7/8 support is discontinued in RAP 3.0. Close as WONTFIX.