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

Bug 319223

Summary: [Usability] Add a Show/Hide menu for the compartment
Product: [Modeling] Papyrus Reporter: Vincent Lorenzo <vincent.lorenzo>
Component: CoreAssignee: Patrick Tessier <Patrick.Tessier>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: sebastien.gerard, selic, yann.tanguy
Version: 0.7.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 320090, 320348, 320360, 320361, 320362, 320363, 320364, 320367, 320465, 341876    
Bug Blocks: 348525    

Description Vincent Lorenzo CLA 2010-07-08 03:33:59 EDT
Currently, we can only Hide or Show all the compartments. It should be interesting to can choose the compartment to show.
Comment 1 Vincent Lorenzo CLA 2010-07-19 11:57:50 EDT
Done in r2410.
A new menu is added in the toolbar, in the popupMenu -> Filters and in the menu Diagram -> Filters
Comment 2 Vincent Lorenzo CLA 2010-07-20 02:45:45 EDT
I reopen the bug, because the custom behavior must be used in the diagram!
Comment 3 Vincent Lorenzo CLA 2010-07-20 04:55:55 EDT
Done for Profile Diagram in r2351.
Comment 4 Vincent Lorenzo CLA 2010-07-20 05:05:51 EDT
Error : for Profile Diagram, it's done in r2418!!!
Done for Class Diagram in r2419.
Comment 5 Yann Tanguy CLA 2010-07-30 05:01:15 EDT
Current implementation is confused with affixed child nodes.

For example: 
- RedefinableTemplate in Class diagram
- Port in Block Definition diagram

Moreover, current implementation does not show correct name for Compartment on Block element in Block Definition diagram.
Currently Block compartment are created using the default factory provided by GMF Runtime to create ListCompartment. This factory creates a new "Node" (with specific Compartment related styles), in GMF Tooling generated diagrams, a "BasicCompartment" is generated instead of "Node". At this point, I understand that it may be interesting to create specialized nodes (although styles is also a good candidate to specify which behaviors are supported by nodes), but in that case I could not figure out why the generated compartment are systematically "BasicCompartment" instead of "ListCompartment" or (Shape)"Compartment" which are available in notation.

Compartment factory used in BDD shall be modified to create specialized node, somehow like done in generated diagrams.
Comment 6 Yann Tanguy CLA 2010-07-30 10:16:48 EDT
Node creation modified in BDD Compartment factory.

Some restriction added in Show/Hide compartment action in order to allow this feature on "BasicCompartment" views only. Doing this, possible affixed node are not listed, but it appears that the runtime does node systematically create "BasicCompartment" for any compartment but only those which are supposed to be collapsable (this would be better handled by style). Other compartment (non-collapsable) are DecorationNode (like NodeLabels).

This results in some compartment being ignored from the Show/Hide list (for instance Package PackageableElement compartment). In case such element should be masked, a possible solution would be to set them as Collapsable and regenerate the diagram.

Done in r2512.
Comment 7 Vincent Lorenzo CLA 2010-08-31 09:33:49 EDT
Add the shortcut CTRL+F5 for this action in r2633
Comment 8 Vincent Lorenzo CLA 2010-09-17 09:07:00 EDT
When the compartment is a DecorationNode, the action doesn't work. (we will have the problem in the Activity Diagram for example)
Comment 9 Vincent Lorenzo CLA 2010-09-17 09:11:19 EDT
In r2734 : the action supports DecorationNode.
Comment 10 Vincent Lorenzo CLA 2010-11-25 04:25:42 EST
Bug : this status of this action is not correctly refreshed in the menu Diagram
Comment 11 Vincent Lorenzo CLA 2010-11-25 05:59:47 EST
Corrected in r3329
Comment 12 Vincent Lorenzo CLA 2011-04-05 05:07:22 EDT
*** Bug 314405 has been marked as a duplicate of this bug. ***
Comment 13 Yann Tanguy CLA 2011-04-28 04:08:55 EDT
The figure does not seem to be redrawn correctly when a compartment is shown that is not created by default (selection and creation issue on elements inside compartments).

To reproduce:
- Create a Class Diagram and modifiy preferences to make Class compartment non-visible by default
- Create a Class
- Use "Show/Hide compartment" action to show Class compartment
- Try to create a feature inside Class Compartment
Comment 14 Yann Tanguy CLA 2011-06-07 05:28:15 EDT
(In reply to comment #13)
> The figure does not seem to be redrawn correctly when a compartment is shown
> that is not created by default (selection and creation issue on elements inside
> compartments).
> 
> To reproduce:
> - Create a Class Diagram and modifiy preferences to make Class compartment
> non-visible by default
> - Create a Class
> - Use "Show/Hide compartment" action to show Class compartment
> - Try to create a feature inside Class Compartment

This is still reproductible in 0.8.0 RC3, I raise the severity because this issue tends to make the feature useless, which is a major problem for diagram the heavily rely on it (SysML BDD in particular).
Comment 15 Patrick Tessier CLA 2011-07-28 04:33:50 EDT
Non visible compartments were badly resized, so I have change  the layout (AutomaticCompartmentLayoutManager).
Now, non visible compartments must not interfere the usage.

It was a bug purely graphic.

Done in the revision 5141 in the branch
Comment 16 Patrick Tessier CLA 2011-07-28 05:05:14 EDT
Merge in the revision 5142 for the trunk
Comment 17 Yann Tanguy CLA 2011-08-01 12:46:00 EDT
Thanks Patrick, I close the bug.