|Coolbar Only Shown When The Workbench Window Is Resized, Redux [message #840172]
||Mon, 09 April 2012 19:06
| Rob Hatcherson
Registered: July 2009
Location: Fort Worth, TX, USA
I've encountered some trim creation and layout issues, one of which is similar to discussion in this thread from 2009 (sorry, it wouldn't let me make a real link here):|
The IDE version I have says:
Build id: M20120208-0800
...and as far as I know everything in Eclipse proper is up to date.
The issues are:
1) I have at least one plugin.xml file that makes coolbar contributions, but after the workbench window initially pops up the coolbar remains hidden until the main window is resized. At that point the coolbar pops in, looks like I expect, and functions normally. This behavior is similar to that discussed in message 140033 noted above.
2) That same plugin.xml attempts to make a contribution to the status bar but the contribution never shows up. I set a breakpoint on the contribution's createControl method but it never got hit. So... in this case the contribution seems to be totally ignored.
Problem 1) suggests some kind of trim layout issue, while Problem 2) is more like a trim creation problem.
For reasons probably not worth getting into here I'm loading contributions from various plugin.xml files via "interim" public API:
The plugin.xml files being loaded make typical contributions, e.g. views, perspectives, menus/toolbars/etc. Other than the technique being used to load them nothing unusual is going on.
I have an IRegistryEventListener in the loop and it shows the contributions being processed from the plugin.xml, including the status bar contribution that is never realized.
I have at least one other app that loads contributions via the RegistryFactory.getRegistry().addContribution(...args...) method, and its coolbar shows up as soon as the workbench window springs to life though it also exhibits Problem 2) noted above. I'm still looking for what the working app is doing that the broken app might not be doing regarding the coolbar, but so far no revelations.
I've spent a good chunk of the last few days snooping around in TrimContributionManager trying to figure out what's going on, but I am a relative noob on RCP internals and don't yet know what to expect to see at various points as the workbench springs to life.
Anybody have any theories about:
- What might be going wrong with contributions loaded through this interim API that would cause either of the problems mentioned above? Limitations, calls I should be making after addContribution() that might be missing, etc.?
- Anything in particular in TrimContributionManager and/or related classes that I can examine to help identify the root cause(s)?
- A way to force the main window to recompute its layout? I've tried some indirect hacks like calling setPerspectiveBarLocation("topLeft") on the window, which in turn calls updateLayoutDataForContents() and getShell().layout(). I didn't expect this to fix Problem 2) noted above, but thought it might stimulate a re-layout of the window to "fix" Problem 1) even though it's a pretty big hammer to use (obviously finding the root cause would be preferred, but I'm also fishing for workarounds). It's possible this may yet work and I'm just calling it too early.
Powered by FUDForum
. Page generated in 0.02049 seconds