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

Bug 439338

Summary: Tools become invisible in toolbar after first use
Product: [Modeling] Sirius Reporter: Stéphane Thibaudeau <stephane.thibaudeau>
Component: DiagramAssignee: Maxime Porhel <maxime.porhel>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: florian.barbin, maxime.porhel, nicolas.debeaupte
Version: 1.0.0Keywords: triaged
Target Milestone: 1.0.1   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 440061, 442847    
Attachments:
Description Flags
Error Log entry none

Description Stéphane Thibaudeau CLA 2014-07-10 09:19:03 EDT
Created attachment 244974 [details]
Error Log entry

I've encountered this problem with both the "align" and "line style" tools.

Steps to reproduce :

1) select an edge on a diagram and use the "line style" button in the toolbar to modify the line style
=> the line style is correctly modified.

2) Unselect the edge and select another edge (or the same one)
=> a NullPointerException is displayed in the Error log
=> the "line style" tool is not visible in the toolbard anymore. One has to close and reopen the diagram so it becomes visible again.
Comment 1 Maxime Porhel CLA 2014-07-10 09:26:49 EDT
Reproduced on master and 1.0.x with several tabbar dropdown buttons: sveral of  our tabbar menu extending ActionMenuManager are impacted (Align, Line style, Select, but not the Arrange menu).

Once the user has displayed one of this menu, it is disposed on the next visibility change.
Comment 2 Maxime Porhel CLA 2014-07-10 09:49:29 EDT
This might be a Platform UI issue. 

As in Bug 430116, IMenuManager is not handled: org.eclipse.jface.action.ToolBarManager.update(boolean) only check if an element is a IContributionItem and decide when it is "clean" or "to remove" (lines 270 and 304), then it dispose some elements. 

GMF brings the ActionMenuManager which is a IMenuManger and can be added in a toolbar. 

It seems tht here like in Bug 430116, the platform should handle the IMenuManager in a specific case (like in https://git.eclipse.org/r/#/c/23347/6/bundles/org.eclipse.ui.workbench/Eclipse+UI/org/eclipse/ui/internal/CoolBarToTrimManager.java).
Comment 3 Maxime Porhel CLA 2014-07-10 10:17:40 EDT
*** Bug 437699 has been marked as a duplicate of this bug. ***
Comment 4 Maxime Porhel CLA 2014-07-10 10:26:12 EDT
Bug 437699 has been marked as DUPLICATE of this issue. 

See its comment. It has been reproduced on Eclipse 3.8 with Sirius 1.0 RC3.

Note that there might be another lead than the specific case to handle the IMenuManager in ToolBarManager. We have to look at our dispose and add methods.
Comment 5 Maxime Porhel CLA 2014-07-22 04:01:17 EDT
See https://git.eclipse.org/r/#/c/30195/
Comment 6 Maxime Porhel CLA 2014-07-24 10:57:03 EDT
Corrected by commit 8b27de9c802e6841545a7f278cd76bfd4f3c12ca
Comment 7 Pierre-Charles David CLA 2015-05-20 07:55:24 EDT
Available in Sirius 1.0.1.