Community
Participate
Working Groups
ToolBarManagerRenderer#createtoolbar() has a MToolBar model to ToolBarManager cache map. However, Orientation of MToolBar(SWT.HORIZONTAL or SWT.VERTICAL) can be changed dynamically since user can drag toolbars to MTrimBar in 4 sides of WBW. When create a ToolBarManager first time, orientation is calculated and applied properly(see ToolBarManagerRenderer#getOrientation), But it is not applied when cached one is used. As a result, when user dragged a toolbar from main trim bar to left sided trim bar, toolbar is rendered as HORIZONTAL. Since ToolBarManager takes item style as it's constructor, and there is no way to modify it later. So cache invalidation algorithm should have to be provided.
Created attachment 233199 [details] patch to test This patch just let ignore existing managers. However, all contributed Item will be reused. Seems works fine for me.
I've come across this while adding the ability to move the toolbars around on the trim. While I'm not sure how often it's used it *is* API that the control for a given manager matches its life cycle. This is why I don't change the orientation of the control when you move it to a 'side' trim. I personally feel that we should remove this particular requirement (clients should not 'cache' the control but get it every time) but this will require PMC sign off...I'm pushing for this myself.
Just had a talk with John Arthorne about this...his first suggestion was that we should try to see what happens if I allow the toolbars to be disposed / recreated during the dragging operation... Interestingly the javadoc for the ToolnarManager's 'getControl()' method doesn't mention that you're guaranteed to get the same control all the time, just that it'll be non-null.
*** Bug 388482 has been marked as a duplicate of this bug. ***
Gerrit review from Wojciech Sudol https://git.eclipse.org/r/#/c/19373/1
(In reply to Lars Vogel from comment #5) > Gerrit review from Wojciech Sudol > https://git.eclipse.org/r/#/c/19373/1 Released as http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=642ec7b601902987e45846fb32929c9a44463993 Thanks Wojtek. PW
(In reply to Paul Webster from comment #6) > (In reply to Lars Vogel from comment #5) > > Gerrit review from Wojciech Sudol > > https://git.eclipse.org/r/#/c/19373/1 > > Released as > http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/ > ?id=642ec7b601902987e45846fb32929c9a44463993 Is there more work left, or can this bug be closed?
Just need verification that this patch does indeed allow me to drag a toolbar from the top trim to either the left / right trim...I'll mark this as fixed and re-open after we test the milestone if necessary.
Verified in I20131209-2000.