This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 412479 - ToolBarManagerRenderer doesn't care orientation changing of MToolBar because of it's cache.
Summary: ToolBarManagerRenderer doesn't care orientation changing of MToolBar because ...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 4.4 M4   Edit
Assignee: Wojciech Sudol CLA
QA Contact: Wojciech Sudol CLA
URL:
Whiteboard:
Keywords:
: 388482 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-07-08 04:50 EDT by Jeeeyul Lee CLA
Modified: 2013-12-10 07:19 EST (History)
6 users (show)

See Also:


Attachments
patch to test (1.15 KB, patch)
2013-07-08 05:19 EDT, Jeeeyul Lee CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeeeyul Lee CLA 2013-07-08 04:50:20 EDT
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.
Comment 1 Jeeeyul Lee CLA 2013-07-08 05:19:57 EDT
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.
Comment 2 Eric Moffatt CLA 2013-07-09 13:57:05 EDT
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.
Comment 3 Eric Moffatt CLA 2013-10-07 14:56:21 EDT
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.
Comment 4 Eric Moffatt CLA 2013-11-04 14:35:40 EST
*** Bug 388482 has been marked as a duplicate of this bug. ***
Comment 5 Lars Vogel CLA 2013-12-05 08:45:18 EST
Gerrit review from Wojciech Sudol 
https://git.eclipse.org/r/#/c/19373/1
Comment 6 Paul Webster CLA 2013-12-09 09:18:36 EST
(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
Comment 7 Dani Megert CLA 2013-12-09 10:22:16 EST
(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?
Comment 8 Eric Moffatt CLA 2013-12-09 13:43:37 EST
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.
Comment 9 Wojciech Sudol CLA 2013-12-10 07:19:38 EST
Verified in I20131209-2000.