Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311007 - [modeling] The TreeViewer selection is not correctly updated after a Deletion
Summary: [modeling] The TreeViewer selection is not correctly updated after a Deletion
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: Incubators (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Benjamin Cabé CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-29 08:33 EDT by Jacques LESCOT CLA
Modified: 2010-06-02 06:17 EDT (History)
1 user (show)

See Also:


Attachments
Set the selection at the TreeViewer level after a Delete is performed. (4.48 KB, patch)
2010-04-29 08:40 EDT, Jacques LESCOT CLA
no flags Details | Diff
The element to remove is not always contained through a multi-valued reference. (4.56 KB, patch)
2010-04-29 11:42 EDT, Jacques LESCOT CLA
contact: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jacques LESCOT CLA 2010-04-29 08:33:53 EDT
The problem happens only when the treeViewer (of the MasterDetails part) is configured with a SWT.MULTI style.
I notice that in order to fix that issue, we should specify the EObject to select at the TreeViewer level, instead of specifying the TreeItem to select at the tree level.
Comment 1 Jacques LESCOT CLA 2010-04-29 08:40:58 EDT
Created attachment 166468 [details]
Set the selection at the TreeViewer level after a Delete is performed.

The selection policy is the following (we are in the "worst" case, where the SWT.MULTI style is applied to the TreeViewer):
1. Find the next sibling element which is not part of the removed elements.
2. Find the previous sibling element which is not part of the removed elements.
3. Select the container element if it is not part of the removed elements

This search mechanism is done over all the elements that are to be removed, starting with the first one.
Comment 2 Jacques LESCOT CLA 2010-04-29 11:42:24 EDT
Created attachment 166508 [details]
The element to remove is not always contained through a multi-valued reference.

This new patch fix an issue in the previous one when element to remove is not contained by a multi-valued feature.
Comment 3 Jacques LESCOT CLA 2010-05-17 09:16:33 EDT
Benjamin, do you have any plan to include the patch I have proposed ? If there are any part I should review/improve, please let me know.
Comment 4 Benjamin Cabé CLA 2010-06-02 06:17:34 EDT
released in HEAD with a slight rename of one of the methods.