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

Bug 277929

Summary: [BlockSelection] Block Selection is not BIDI aware
Product: [Eclipse Project] Platform Reporter: Felipe Heidrich <eclipse.felipe>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact: Felipe Heidrich <eclipse.felipe>
Severity: normal    
Priority: P3 CC: daniel_megert, eclipse, gheorghe, Lina.Kemmel, matial, Mike_Wilson, Silenio_Quarti, snorthov
Version: 3.5Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard: stalebug

Description Felipe Heidrich CLA 2009-05-26 15:09:39 EDT
Eclipse 3.5


Block Selection functionalilty provided by StyledText is not BIDI aware.

When the orientation of characters under the left and right edges of the block selection rectangle are not the same, the actual selection ranges (in memory) differ from the visual representation of the selection.
Comment 1 Felipe Heidrich CLA 2009-08-14 14:51:16 EDT
Your bug has been moved to triage, visit http://www.eclipse.org/swt/triage.php for more info.
Comment 2 Lina Kemmel CLA 2009-10-06 10:33:18 EDT
I think this is an excellent opportunity to implement visual selection in StyledText.

Visual selection is concerned with text *visually displayed* between the start and end selection points (as opposed to logical selection dealing with the *buffer* content between the logical positions of the start and end points).
Visual selection is more intuitive and is preferred by some Bidi users to the logical selection.

Guidelines on visual selection are available as part of "Guidelines of a Logical User Interface for Editing Bidirectional Text" written by Mati Allouche at:
http://www.qsm.co.il/Hebrew/logicUI22.htm#h1-22
(Mati: perhaps you can point to a newer version of this document?)

In StyledText, I currently see the following non-public methods that would be affected:
- int insertBlockSelectionText(String text, boolean fillWithSpaces)
- void insertBlockSelectionText(char key, int action)
- String getBlockSelectionText(String delimiter)
Comment 3 Felipe Heidrich CLA 2009-10-08 14:37:14 EDT
(In reply to comment #2)
> I think this is an excellent opportunity to implement visual selection in
> StyledText.

Disagree. To implement visual selection will you need (at least):
Add MOVEMENT_CLUSTER_VISUAL (maybe others) to 
TextLayout#getNextOffset
TextLayout#getPreviousOffset
Add VISUAL_SELECTION as new flag to:
TextLayout#draw(G, int, int, int, int, Color, Color, int)

This is a lot of work. 
Block selection will never replace the regular selection.

> In StyledText, I currently see the following non-public methods that would be
> affected:
> - int insertBlockSelectionText(String text, boolean fillWithSpaces)
> - void insertBlockSelectionText(char key, int action)
> - String getBlockSelectionText(String delimiter)

getSelectionRanges()
is other places too possibily (didn't check all the references).
Comment 4 Lina Kemmel CLA 2010-12-29 08:14:12 EST
OK, so by making block selection to be logical, we will cause it to be always continuous in the buffer, but possibly discontinuous in display. This means that user will sometimes see more than 1 block (selection rectangle).
I think this behavior is actually inconsistent with the nature of the "block selection" itself.
Comment 5 Leo Ufimtsev CLA 2017-08-03 12:30:39 EDT
This is a one-off bulk update. (The last one in the triage migration).

Moving bugs from swt-triaged@eclipse to platform-swt-inbox@eclipse.org and adding "triaged" keyword as per new triage process:
https://wiki.eclipse.org/SWT/Devel/Triage

See Bug 518478 for details.

Tag for notification/mail filters:
@TriageBulkUpdate
Comment 6 Eclipse Genie CLA 2019-09-13 17:15:46 EDT
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.

--
The automated Eclipse Genie.