Community
Participate
Working Groups
If I set the visible property of an MToolBar item to false it stays visible in the toolbar.
To reproduce: try via live model editor or use the modelservice to search for a MToolItem and set its visible to false.
I think we need to write a method similar to toBeRenderedUpdater in ToolBarManagerRenderer
(In reply to Lars Vogel from comment #2) > I think we need to write a method similar to toBeRenderedUpdater in > ToolBarManagerRenderer I don't think that it is managed via the ToolBarManagerRenderer. For some reason this class's TBR listener has a check ' if xxx instanceof MToolBarElement' which no MToolBar satisfies. That is more meant for the MToolbarItems rather then the toolbar themselves. Their rendering or non rendering is managed at the PartRenderingEngine level.
The other place you can check is the org.eclipse.e4.ui.workbench.renderers.swt.TrimBarRenderer The MTrimBar holds all of the toolbars or tool controls for that trim PW
Note that an MToolBar *is* an MTrimBarElement...so the instanceof seems correct to me...
New Gerrit change created: https://git.eclipse.org/r/42344
Looks like the missing part in ToolBarManagerRenderer was to tell the ToolBar parent to also update. Not sure, but from the description it sounds like this should also fix Bug 432856.
(In reply to Dirk Fauth from comment #7) > Looks like the missing part in ToolBarManagerRenderer was to tell the > ToolBar parent to also update. > > Not sure, but from the description it sounds like this should also fix Bug > 432856. Dirk, if I try this in 4.5.0.I20150203-1300 the update of the update of the toolbar works fine, even without your patch. Can you still reproduce the error with the latest release? If so, can you tell me how?
Hm, with the latest sources you are right, the issue related to the visible flag seems to be fixed even without my patch. That wasn't the case a few days ago. Nevertheless, my patch seems to be necessary since it updates the toolbar layout. Say you have a part toolbar that contains 3 items. The first is visible, the second hidden, the third visible (in my case the third shows a label). When making the second item visible, the third item is only shown partially because of the missing re-layout of the toolbar.
(In reply to Dirk Fauth from comment #9) > Hm, with the latest sources you are right, the issue related to the visible > flag seems to be fixed even without my patch. That wasn't the case a few > days ago. > > Nevertheless, my patch seems to be necessary since it updates the toolbar > layout. > > Say you have a part toolbar that contains 3 items. The first is visible, the > second hidden, the third visible (in my case the third shows a label). When > making the second item visible, the third item is only shown partially > because of the missing re-layout of the toolbar. Can you reproduce it with CPD dialog? Disabling one of the buttons in the main toolbar seem not have any visible artifacts (at least on Linux).
Created attachment 251074 [details] Example project (In reply to Dirk Fauth from comment #9) > Say you have a part toolbar that contains 3 items. The first is visible, the > second hidden, the third visible (in my case the third shows a label). When > making the second item visible, the third item is only shown partially > because of the missing re-layout of the toolbar. I cannot reproduce. Attached an example project which uses your setup (I think). Second toolitem is invisible and if I use the model spy to make it visible, the layout looks fine for me.
I'll check your example. I also uploaded an example to GitHub that I use to work on the core expression issues. https://github.com/fipro78/e4toolbarexample On Windows the last item in the part toolbar is only shown partially when another item is made visible. The buttons with the Eclipse icons can be used to change the visible state. P.S. What is the CPD dialog?
I can reproduce the issue with your example using the Model Spy. If I dynamically set the test tool item to visible, the Quit item vanishes. If I set it to invisible again, the Quit item appears again. With my patch, the toolbar is updated correctly. Tested on Windows.
I thought about this for a while, and IMHO the situation is the following: 1. The update of the visible flag for toolbar items is reflected correctly with the current codebase. My patch has no effect on that. 2. The toolbar is not re-layouted according to the changes (at least on Windows), which is now done with my patch. If the hidden item is the one to the right, it doesn't become visible, so this ticket sounds like the ticket regarding the re-layout. IMHO my patch addresses Bug 432856 and not this one, since this one seems to be already fixed with some other patches. I don't know why you don't see this issue, but I also don't know how the part toolbar is rendered on Linux. In Windows the items are right aligned and without the re-layout of the toolbar parent (my patch), the toolbar menu grows to the right without updating the start position. So the right border moves out of the visible area. As IMHO my patch is still necessary (but for another ticket), is it possible to connect the patch to another Bug? Should I update the commit message and the copyright header so it is connected to Bug 432856?
(In reply to Dirk Fauth from comment #14) > 2. The toolbar is not re-layouted according to the changes (at least on > Windows), which is now done with my patch. I'm about to test your patch on Windows.
Gerrit change https://git.eclipse.org/r/42344 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=d27e6b625421d8fd6f59c5d434191c74890dc54a
Thanks Dirk for Windows this additional call is necessary, must be one of these SWT issuess.
I'm not sure why yet but this seems to have caused a regression in CDT, see bug 463245.