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

Bug 313881

Summary: [Usability] Stereotype attributes are collapsed after assignment or re-selecting of source elements
Product: [Modeling] Papyrus Reporter: Ansgar Radermacher <ansgar.radermacher>
Component: CoreAssignee: Project Inbox <mdt-papyrus-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: Patrick.Tessier, rschnekenburger
Version: unspecifiedFlags: sebastien.gerard: iplog-
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Does not refresh complete treebrowser, nodes are not collapsed
sebastien.gerard: iplog+
Fix of fix
sebastien.gerard: iplog+
Up/down sebastien.gerard: iplog+

Description Ansgar Radermacher CLA 2010-05-21 04:42:39 EDT
Build Identifier: Build id: 20100506-2000

If the user wants to assign values to a stereotype attribute, he has to "un-collapse" the tree to get access to an attribute. As soon, as a value is assigned, the stereotype view is collapsed again, requiring a re-opening if the user wants to inspect the assigned value or assign another stereotype value.

Keeping the attribute openend would also be useful, if the user likes to inspect same stereotype attribute of multiple elements: for instance, in my profile each port carries an attribute "port-kind", and I'd like to investigate this attribute for multiple ports. In the current version of eclipse, I have to reopen the attribute view each time when I select another port in my diagram.

Reproducible: Always
Comment 1 Ansgar Radermacher CLA 2010-07-09 10:28:03 EDT
Created attachment 173867 [details]
Does not refresh complete treebrowser, nodes are not collapsed

Refreshes only the currently selected element. Requires however a change of the model update from asynchronous to synchronous (via OperationHistory), since the refresh would otherwise be done before the model update and would therefore remain in-effective.
Comment 2 Patrick Tessier CLA 2010-07-09 11:59:17 EDT
patch applied in the revision 2338
Comment 3 Ansgar Radermacher CLA 2010-07-18 14:59:01 EDT
Created attachment 174582 [details]
Fix of fix

The original patch works fine for "normal" profiles. However, in a static profile, the modification of one stereotype attribute might lead to the modification of another (derived) attribute. It is therefore required to redraw the whole tree. This patch redraws the whole tree but assures that the selection and collapsed state remains untouched. It did not work in the original version, since the getChildren operation of P superclass of ParentTreeObject (a superclass of the content provider) always re-created the children.
Comment 4 Remi Schnekenburger CLA 2010-07-20 07:43:46 EDT
(In reply to comment #3)
> Created an attachment (id=174582) [details]
> Fix of fix
> 
> The original patch works fine for "normal" profiles. However, in a static
> profile, the modification of one stereotype attribute might lead to the
> modification of another (derived) attribute. It is therefore required to redraw
> the whole tree. This patch redraws the whole tree but assures that the
> selection and collapsed state remains untouched. It did not work in the
> original version, since the getChildren operation of P superclass of
> ParentTreeObject (a superclass of the content provider) always re-created the
> children.

Applied in r2429. I let you close the bug if every thing works fine for you.
Comment 5 Ansgar Radermacher CLA 2010-07-21 12:05:54 EDT
Created attachment 174877 [details]
Up/down

This additional patch fixes moving stereotype values (in case of multi-value) up and down. Before, the associated commands were not executed in a transaction and caused an exception. Also display refresh was done in an inconsistent way. The patch also removes some dead code.

The existing code, in particular in org.eclipse.papyrus.profile.tree.objects should be reviewed/revised in the future (a lot of warning dues to raw types, attributes of super classes are duplicated due to typing issues).
Comment 6 Remi Schnekenburger CLA 2010-07-21 13:19:05 EDT
(In reply to comment #5)
> Created an attachment (id=174877) [details]
> Up/down
> 
> This additional patch fixes moving stereotype values (in case of multi-value)
> up and down. Before, the associated commands were not executed in a transaction
> and caused an exception. Also display refresh was done in an inconsistent way.
> The patch also removes some dead code.
> 
> The existing code, in particular in org.eclipse.papyrus.profile.tree.objects
> should be reviewed/revised in the future (a lot of warning dues to raw types,
> attributes of super classes are duplicated due to typing issues).

Applied in r2444. Thanks!
Comment 7 Ansgar Radermacher CLA 2010-09-06 10:10:30 EDT
Fixed by attached patches