Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 374326 - [Compatibility] ToolControl in toolbar using visibleWhen doesn't show up
Summary: [Compatibility] ToolControl in toolbar using visibleWhen doesn't show up
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: 4.2 M7   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 374673
  Show dependency tree
 
Reported: 2012-03-14 19:19 EDT by Paul Webster CLA
Modified: 2015-08-05 14:56 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Webster CLA 2012-03-14 19:19:16 EDT
I used org.eclipse.ui.menus to add a toolbar with 3 commands and a tool control.  I used a visibleWhen (if one IResource is selected) to make the tool control visible.

In 3.8 the control (a combo) appears and disappears at the end of that toolbar.  In 4.2, an empty space appears and disappears at the end of that toolbar.

https://github.com/paulweb515/eclipseExamples/blob/master/org.eclipse.example.commands.toolbar/plugin.xml#L61


This is important as it is one of the patterns we've given to other projects to get away from actionSets and hacking the WorkbenchWindow coolbar (which doesn't exactly exist in 4.2 :-)

PW
Comment 1 Paul Webster CLA 2012-03-14 19:22:12 EDT
We put a hook in the PartRenderingEngine to avoid rendering children of a top MMenu, since the MenuManagerRenderer enforces the rendering of the children.

The ToolBarRenderer works the same way, but there's no hook in the PRE, and so when the child is added it looks like it is interacting with the hidden shell.

Can we talk tomorrow morning about options for fixing this?

PW
Comment 2 Paul Webster CLA 2012-03-15 13:48:01 EDT
I've pushed my fix as pwebster/bug374326


Include 3 types of changes:

1. ToolControlContribution doesn't correctly re-fill, because filling is
controled by the @PostConstruct method.  We should uninject the object
on control.dispose and create a new one on fill.

2. push a RAT manager.update(*) outside of the RAT.  As any injected
object can update the IEclipseContext in its @PostConstruct, we need to
be careful

3. remove an MToolControl in an MToolBar from the standard visibility
event handlers.  This is similar to how children of MMenu are already
exempt.


PW
Comment 3 Remy Suen CLA 2012-03-15 13:59:33 EDT
I added a test to the pwebster/bug374326 branch.
Comment 4 Paul Webster CLA 2012-03-16 20:02:49 EDT
Released for M7
PW
Comment 5 Paul Webster CLA 2012-05-01 15:14:16 EDT
In I20120430-1800
PW
Comment 6 Eclipse Genie CLA 2015-08-05 07:09:01 EDT
New Gerrit change created: https://git.eclipse.org/r/53219