Bug 511769 - JFace TreeViewer using Tree with SWT.MULTI flag and drag and drop support provokes graphic problem when refocusing already selected item
Summary: JFace TreeViewer using Tree with SWT.MULTI flag and drag and drop support pro...
Status: REOPENED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.7   Edit
Hardware: PC Windows NT
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-06 09:45 EST by Pierre Guilet CLA
Modified: 2021-01-26 14:26 EST (History)
6 users (show)

See Also:


Attachments
Project to reproduce the problem (31.89 KB, application/x-zip-compressed)
2017-02-06 09:45 EST, Pierre Guilet CLA
no flags Details
Picture of the problem (8.76 KB, image/png)
2017-02-06 09:47 EST, Pierre Guilet CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Guilet CLA 2017-02-06 09:45:49 EST
Created attachment 266669 [details]
Project to reproduce the problem

In various contexts,using a JFace TreeViewer with a tree using the flag SWT.MULTI and the drag and drop support (org.eclipse.jface.viewers.StructuredViewer.addDragSupport) and refocusing an already selected tree item can hide others tree items by setting a blue background and text color like in the attached picture.

I also attached for reproduction a minimal project using an JFace TreeViewer with a SWT.MULTI Tree and a drag and drop support:

Steps to reproduce:
1-Import the attached project.
2-Launch a runtime
3-Create a project and a text file inside.
4-Open the text file with the "Sample multi-pages editor" editor.
5-Select the first item.
6-Select the text file in Package explorer. 
7-Re click on the first item => KO. Other items disappeared.

Then if you comment the line:
selectionViewer.addDragSupport(dndOperations, transfers, new DragSourceListener()

or if you set the Tree flag to SWT.SINGLE 

the problem is gone.

In some other contexts, with different graphic constructions but still using JFace TreeViewer with SWT.MULTI Tree and Drag and drop support, the problem is not present.

Is there something to know when using this combination or is it a bug and is there a workaround?
Comment 1 Pierre Guilet CLA 2017-02-06 09:47:33 EST
Created attachment 266670 [details]
Picture of the problem
Comment 2 Pierre Guilet CLA 2017-02-06 09:54:31 EST
I forgot to tell the problem is at least on Windows 10. Not tested on linux.
Comment 3 Pierre-Charles David CLA 2017-02-07 09:09:12 EST
(In reply to Pierre Guilet from comment #2)
> I forgot to tell the problem is at least on Windows 10. Not tested on linux.

Does not appear under Linux, at least Ubuntu 16.10, Java 1.8.0_121-b13, Eclipse Neon.2 and GTK 3.20.9 (neither can the original scenario we had in the context of Sirius).
Comment 4 Kapil Thombare CLA 2018-03-29 20:23:34 EDT
Even I see the same problem on windows 10. When drag support added to treeviewers and if we select the item currently selected , then the other treeitems become invisible. On linux everything works as expected. Do we have any fix/workaround for this? 

Note that this happens on win10 only when the SWT.MULTI flag is set on the tree viewer, but for me SWT.MULTI is required.

Cheers
-Kapil
Comment 5 Sai krishna CLA 2018-04-03 02:55:52 EDT
I have come across the same problem in Windows 7 too. Does this have anything to do with the implementation of TreeViewer?

Ksai.
Comment 6 Dhiresh Patel CLA 2019-02-04 20:29:33 EST
We are migrating Eclipse 3.x to eclipse 4 and running into above problem in both windows 7 and windows 10.  Is there a work around for this problem?
Comment 7 Pierre-Charles David CLA 2019-02-05 02:31:16 EST
In Sirius we implemented a workaround [1] inspired by this patch [2] found in the platform itself.

[1] https://git.eclipse.org/r/c/96393
[2] https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=052d5d66f0a1b483abcc639dc36dfb9820a326dc
Comment 8 Eclipse Genie CLA 2021-01-26 11:28:55 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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.
Comment 9 Wim Jongman CLA 2021-01-26 14:26:02 EST
Still an issue. I imported the project and it is not fixed in 2020-12