Bug 70049 - [PerspectiveBar] Coolbar Default Height is Gigantic
Summary: [PerspectiveBar] Coolbar Default Height is Gigantic
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
: 52590 (view as bug list)
Depends on: 104517 104545
Blocks:
  Show dependency tree
 
Reported: 2004-07-14 14:55 EDT by richard redpath CLA
Modified: 2009-08-03 13:39 EDT (History)
9 users (show)

See Also:


Attachments
Picture of before and after (410.33 KB, application/octet-stream)
2004-07-14 14:55 EDT, richard redpath CLA
no flags Details
marked with //redpath (4.52 KB, text/plain)
2004-07-14 14:57 EDT, richard redpath CLA
no flags Details
Minimal "Hello, World" RCP project (12.37 KB, application/octet-stream)
2004-08-09 18:22 EDT, Dan Kehn CLA
no flags Details
Screenshot of "Hello, World" (46.19 KB, image/pjpeg)
2004-08-09 18:23 EDT, Dan Kehn CLA
no flags Details
Test case (patch for org.eclipse.ui.tests.rcp) (7.82 KB, patch)
2005-07-21 14:42 EDT, Boris Bokowski CLA
no flags Details | Diff
Test case, including changes to make the RCP tests run in a separate session (patch for org.eclipse.ui.tests.rcp) (8.40 KB, patch)
2005-07-26 17:22 EDT, Boris Bokowski CLA
no flags Details | Diff
proposed bugfix, patch for o.e.ui.workbench (3.39 KB, patch)
2005-07-26 17:30 EDT, Boris Bokowski CLA
no flags Details | Diff
improved bugfix (call to layout was missing), patch for o.e.ui.workbench (4.12 KB, patch)
2005-07-27 10:59 EDT, Boris Bokowski CLA
no flags Details | Diff
new patch (3.27 KB, patch)
2006-06-23 18:10 EDT, Boris Bokowski CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description richard redpath CLA 2004-07-14 14:55:03 EDT
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.
Comment 1 richard redpath CLA 2004-07-14 14:55:51 EDT
Created attachment 13258 [details]
Picture of before and after
Comment 2 richard redpath CLA 2004-07-14 14:57:37 EDT
Created attachment 13261 [details]
marked with //redpath
Comment 3 B. Chen CLA 2004-07-29 15:09:03 EDT
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. 
Comment 4 Michael Van Meekeren CLA 2004-07-29 15:54:03 EDT
regarding comment #3 , I think you are seeing bug 68774 , which has been fixed.
Comment 5 Dan Kehn CLA 2004-08-09 10:57:36 EDT
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.
Comment 6 Billy Biggs CLA 2004-08-09 16:15:33 EDT
Do you have a simple application which reproduces this problem?  I can't
reproduce this using Eclipse itself...
Comment 7 Dan Kehn CLA 2004-08-09 18:21:26 EDT
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).
Comment 8 Dan Kehn CLA 2004-08-09 18:22:19 EDT
Created attachment 13837 [details]
Minimal "Hello, World" RCP project
Comment 9 Dan Kehn CLA 2004-08-09 18:23:45 EDT
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.
Comment 10 Billy Biggs CLA 2004-08-24 18:07:03 EDT
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);
Comment 11 Dan Kehn CLA 2004-08-24 18:25:38 EDT
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.
Comment 12 B. Chen CLA 2005-01-24 23:11:13 EST
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.
Comment 13 Michael Van Meekeren CLA 2005-07-14 16:15:03 EDT
Boris could you look at this for M1?
Comment 14 Michael Van Meekeren CLA 2005-07-14 16:16:02 EDT
as this bug has more information, I'm marking bug 52590 as a dup
Comment 15 Michael Van Meekeren CLA 2005-07-14 16:17:20 EDT
*** Bug 52590 has been marked as a duplicate of this bug. ***
Comment 16 Boris Bokowski CLA 2005-07-20 14:14:14 EDT
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...
Comment 17 Boris Bokowski CLA 2005-07-20 14:21:47 EDT
Added a dependency to bug 104545 to track SWT's progress on this.
Comment 18 Boris Bokowski CLA 2005-07-21 14:42:39 EDT
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.
Comment 19 Boris Bokowski CLA 2005-07-26 17:22:27 EDT
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.
Comment 20 Boris Bokowski CLA 2005-07-26 17:23:12 EDT
This bug no longer depends on 104545.
Comment 21 Boris Bokowski CLA 2005-07-26 17:25:37 EDT
Added dependency to bug 104517, which is needed for running the RCP tests in a
separate session.
Comment 22 Boris Bokowski CLA 2005-07-26 17:30:30 EDT
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.
Comment 23 Boris Bokowski CLA 2005-07-26 17:34:58 EDT
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!
Comment 24 Boris Bokowski CLA 2005-07-27 10:59:08 EDT
Created attachment 25354 [details]
improved bugfix (call to layout was missing), patch for o.e.ui.workbench
Comment 25 Boris Bokowski CLA 2005-07-27 18:59:45 EDT
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!
Comment 26 Nick Edgar CLA 2005-07-28 10:09:02 EDT
Ok.
Comment 27 Boris Bokowski CLA 2005-08-08 11:48:20 EDT
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.
Comment 28 Boris Bokowski CLA 2005-09-13 16:11:57 EDT
Setting target milestone to 3.2 since bug 104545 has not been fixed yet.
Comment 29 Boris Bokowski CLA 2006-05-23 12:27:17 EDT
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.
Comment 30 Boris Bokowski CLA 2006-06-23 18:10:06 EDT
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.
Comment 31 Boris Bokowski CLA 2006-07-31 05:54:55 EDT
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.
Comment 32 Steven Wasleski CLA 2006-08-03 12:37:53 EDT
Beth, do you have any comment?  I think you wanted this the most.  The "after" image looks good to me.
Comment 33 Boris Bokowski CLA 2006-08-14 23:47:26 EDT
Deferring to 3.3.
Comment 34 Boris Bokowski CLA 2007-04-27 09:02:56 EDT
Deferring since I haven't heard back.
Comment 35 Mike Wilson CLA 2008-04-12 11:25:15 EDT
Closing for lack of activity. See request for more info in comment #31 and #32. Please re-open if this is still an issue.

Comment 36 Mike Wilson CLA 2008-04-12 11:25:34 EDT
Bugzilla!