Community
Participate
Working Groups
The SWT.DEFAULT in the CoolBar is SWT.DEFAULT_WIDTH which is 64 pels. This is wrappered in CacheWrapper layout which listens to the default and hence the coolbar is 64 pels and the PerspectiveBar uses 16 pel images and as a result you have a huge gap. There is a before and after picture. I had to edit CacheWrapper.java code which I have enclosed too.
Created attachment 13258 [details] Picture of before and after
Created attachment 13261 [details] marked with //redpath
Not sure if it's the same problem. If we setShowCoolBar(false), and setShowPerspectiveBar(true) in the preOpenWindow(). We will get a null pointer exception.
regarding comment #3 , I think you are seeing bug 68774 , which has been fixed.
Is this a 3.0.1 candidate? We've noticed the same problem, i.e., default is huge. This causes a disconcerting relayout for RCP apps when the first editor is opened as the toolbar area resizes from 64 pels to the true tool image size.
Do you have a simple application which reproduces this problem? I can't reproduce this using Eclipse itself...
Really? Maybe it is the combination of advisor options: public void preWindowOpen(IWorkbenchWindowConfigurer configurer) { super.preWindowOpen(configurer); configurer.setShowMenuBar(false); configurer.setShowCoolBar(true); configurer.setShowPerspectiveBar(true); configurer.setShowStatusLine(true); configurer.setShowProgressIndicator(true); } In any case, I'm attaching a very small project as a zip file. It is less than the "Hello, World" RCP application and it demonstrates the problem (see attached screenshot).
Created attachment 13837 [details] Minimal "Hello, World" RCP project
Created attachment 13838 [details] Screenshot of "Hello, World" Notice the height of the toolbar. It reduces to a more "normal" size after you open an editor.
The blank space is because the CoolBar is empty. If you add a button, the CoolBar becomes a normal size. I do not think it is valid to have an empty toolbar in an application, usually you have some toolbar buttons which are always there but grayed out. I added the following code to fillActionBars() in MyRCPWorkbenchAdvisor to add a button and the coolbar was sized appropriately on startup: IToolBarManager toolBar = new ToolBarManager(SWT.FLAT | SWT.RIGHT); configurer.getCoolBarManager().add(new ToolBarContributionItem(toolBar, "standard")); RetargetAction fooAction = new RetargetAction("foo", "&foo"); ActionContributionItem fooCI = new ActionContributionItem(fooAction); fooCI.setMode(ActionContributionItem.MODE_FORCE_TEXT); toolBar.add(fooCI);
I agree, if there's one button, no problem. However, our application starts with no open perspectives and thus no coolbar buttons. That doesn't seem such an odd thing to do. Even so, what's the harm in choosing a default that makes more sense? Sixty-four pels is large by any reasonable measure.
We have to keep porting our fix for this problem for each release of our product. Could this problem be considered for 3.0.2? The fix we came up is attached to this bug, please review and consider.
Boris could you look at this for M1?
as this bug has more information, I'm marking bug 52590 as a dup
*** Bug 52590 has been marked as a duplicate of this bug. ***
There are two options: Either SWT changes the default size for empty composites (or just toolbars and coolbars) to something much smaller than 64 (16? 0?), or we could fix this on our side. I'm trying the SWT route first...
Added a dependency to bug 104545 to track SWT's progress on this.
Created attachment 25146 [details] Test case (patch for org.eclipse.ui.tests.rcp) This patch adds support for running individual RCP tests as session tests so that only the minimal set of RCP plug-ins is used.
Created attachment 25328 [details] Test case, including changes to make the RCP tests run in a separate session (patch for org.eclipse.ui.tests.rcp) This patch changes the way the RCP tests are run: only the minimal set of required RCP plug-ins is enabled. I have added a comment to the Javadoc of RcpTestSuite. The bug described in this bugzilla can only be reproduced in this context, and I think it is cleaner anyway to let the RCP tests run with only the set of required plug-ins.
This bug no longer depends on 104545.
Added dependency to bug 104517, which is needed for running the RCP tests in a separate session.
Created attachment 25329 [details] proposed bugfix, patch for o.e.ui.workbench This fix hides the coolbar whenever there are no items in it. It also hides the top bar if the coolbar is hidden and the perspective switcher is on the left.
Nick, could you have a look at this fix (and, in particular, at the change how the RCP tests are run) and commit it for me if you like it? Thanks!
Created attachment 25354 [details] improved bugfix (call to layout was missing), patch for o.e.ui.workbench
Nick, please don't apply the patches just yet, I have looked at a related issue (bug 102885), and I now think that it would be best to fix both issues at the same time. Instead, it would be good if you could assign this bug back to me. Thanks!
Ok.
The current layout code is already pretty complex. Fixing this ourselves (rather than SWT fixing bug 104545) would make matters worse. Moving to 3.2 M2 and adding the dependency on 104545 again.
Setting target milestone to 3.2 since bug 104545 has not been fixed yet.
I'm sorry to say this, but the fix to bug 104545 was not sufficient to resolve the gigantic toolbar issue. Unfortunately, it is now too late to fix this for 3.2.
Created attachment 45225 [details] new patch This patch makes the coolbar's size at least 1x1 pixels which prevents SWT from expanding it to the default of 64x64.
Could the interested parties please confirm that this patch (really just a workaround) fixes their problem when applied to 3.2? I would also like to know if you consider this a critical enough bug to fix (i.e. of the stop ship kind) for 3.2.1.
Beth, do you have any comment? I think you wanted this the most. The "after" image looks good to me.
Deferring to 3.3.
Deferring since I haven't heard back.
Closing for lack of activity. See request for more info in comment #31 and #32. Please re-open if this is still an issue.
Bugzilla!