Bug 260255 - [CoolBar] Items overlap each other
Summary: [CoolBar] Items overlap each other
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.3 M3   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2009-01-07 09:17 EST by Scott Warner CLA
Modified: 2009-10-12 08:17 EDT (History)
3 users (show)

See Also:


Attachments
correctToolbar.gif (1.92 KB, image/gif)
2009-05-25 06:57 EDT, Markus Krüger CLA
no flags Details
incorrectToolbar1.gif (1.75 KB, image/gif)
2009-05-25 06:57 EDT, Markus Krüger CLA
no flags Details
incorrectToolbar2.gif (1.76 KB, image/gif)
2009-05-25 06:57 EDT, Markus Krüger CLA
no flags Details
testcase (10.00 KB, application/zip)
2009-05-26 05:06 EDT, Dmitry Pryadkin CLA
no flags Details
"Strange" patch that helps to fix problem (867 bytes, patch)
2009-06-29 09:47 EDT, Igor Pavlenko CLA
no flags Details | Diff
Patch (45.29 KB, text/plain)
2009-08-24 09:43 EDT, Markus Krüger CLA
no flags Details
Possible solution (?) (1.32 KB, patch)
2009-10-08 12:32 EDT, Tim Buschtoens CLA
ruediger.herrmann: iplog+
Details | Diff
Update for CoolItem tests (1.78 KB, patch)
2009-10-09 06:15 EDT, Tim Buschtoens CLA
ruediger.herrmann: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Warner CLA 2009-01-07 09:17:40 EST
Using the 1.2 M3 build of RAP, toolbars are sometimes not rendered correctly.  This works correctly in the RCP version of the application.  
My application has 3 perspectives and uses action sets to change the toolbar items to be specific for each perspective.  These toolitems include buttons to change to the other perpsectives using "PlatformUI.getWorkbench().showPerspective()".  After switching among the perpsectives several times the toolbar is no longer rendered against the left edge of the window as it should.  Instead it appears that there is a toolbar the size of the one shown by the previous perspective with no items in it that prevents the visible toolbar from showing in the correct place.  When I attempt to move the toolbar to the left it will just snap back to its original location.  When I change perspectives again the tool bar may or may not be rendered against the left edge of the window.
Comment 1 Ivan Furnadjiev CLA 2009-02-05 10:41:29 EST
Can you provide a snippet to reproduce the problem?
Comment 2 Markus Krüger CLA 2009-02-09 09:51:46 EST
Hi,
I have the same problem if I add an actionSet via perspective extensions somewhere in the toolbar, except if I add it at the end.
Regards,
Markus
Comment 3 Markus Krüger CLA 2009-05-18 05:16:13 EDT
Now the problem becomes some higher prio for us.
Having items contributet with org.eclipse.ui.menus extension point also has a not satisfying rendering effect. I added a login command at the beginning of the toolbar. This one should be only visible if not logged in. Now after login this command is set to be not visible anymore (visibleWhen) and instead a logout command should appear at the beginning. The switch between login and logout comman works corretly, but the logout button is not at the beginnning of the toolbar but somewhere in the middle of the toolbar, almost at the end.
Is it possible to give this bug a higher prio and fix it? We work a lot with this extensionpoint.
Comment 4 Markus Krüger CLA 2009-05-25 06:56:48 EDT
Some more issues on this one:
Even the initial look of the toolbar is messed up most of the time,
See my attachments.
First look at the corret displayed toolbar "correctToolbar.gif". This is the way it should look all the time. Then look at "incorrectToolbar1.gif". You will see that the key (login) is overlayed partly with the save button and that the "info" button overlays the "new editor" (the icon with the plus) completely, although this one should be at the end of the toolbar. Now, have a look at "incorrectToolbar2.gif". This toolbar is almost corret, except that the key button overlays the save button this time.

Only server restart changes the behavior, so I guess it have something to do with the use of the extensions (in my case mostly org.eclipse.ui.menus).

Since now our application is messed up some times I hope that this will be fixed as soon as possible.
Comment 5 Markus Krüger CLA 2009-05-25 06:57:09 EDT
Created attachment 136991 [details]
correctToolbar.gif
Comment 6 Markus Krüger CLA 2009-05-25 06:57:26 EDT
Created attachment 136992 [details]
incorrectToolbar1.gif
Comment 7 Markus Krüger CLA 2009-05-25 06:57:52 EDT
Created attachment 136993 [details]
incorrectToolbar2.gif
Comment 8 Dmitry Pryadkin CLA 2009-05-26 05:06:48 EDT
Created attachment 137124 [details]
testcase

I've attached a testcase. It explains itself during running.

In my application I have more complicated toolbars. And I do have bugs in them, just like those described. However I could not reproduce exactly the same behavior in my testcase. 

I did head-cutting alterations to the application. And I guess that the behavior depends on the order of contributions made to Coolbar.
Comment 9 Markus Krüger CLA 2009-05-26 05:51:53 EDT
I just noticed, that after resize of my browser window (my RAP application uses full screen width and height) the toolbar redraws and everything looks correctly afterwards, at least for my case. Maybe just a redraw is missing somewhere...
Comment 10 Markus Krüger CLA 2009-05-26 05:54:40 EDT
Maybe bug: 237268 is related to this one, too???
Comment 11 Igor Pavlenko CLA 2009-06-29 09:47:10 EDT
Created attachment 140369 [details]
"Strange" patch that helps to fix problem

Hello

I do not know the root cause of this problem, but this patch works. In this patch I only commented out 3 rows in ToolBarContributionItem.

Additionally I saw that the DOM-model in the browser is very strange in the moment when one toolbar hides another one. If you have a set of toolbars on the CoolBar-panel you can see that all of them relates to some DIV-elements, but there are a set of "parent" div elements that used to layout. And the locations of that elements are correct. All toolbars should relates to these divs. But one toolbar (with incorrect location) does not relate to any layout div.

I write more comlex description about strange DOM appearance, but it is not very hard to get in from your browser (if you have to). You can use firebug, fore example.

Thank you, Igor
Comment 12 Tim Buschtoens CLA 2009-08-24 08:37:08 EDT
Could not reproduce the problem with the snippet.
Comment 13 Markus Krüger CLA 2009-08-24 09:43:10 EDT
Created attachment 145420 [details]
Patch

I have an old patch for the RAP demo that might contain some overhead, but you can reproduce the problem with it.

Just apply the patch and run the demo. Most of the times the toolbar initially is messed up. If not, just switch perspectives back and forth and you should also get the messed up toolbar.

Hope that helps.
Comment 14 Tim Buschtoens CLA 2009-10-08 12:32:33 EDT
Created attachment 149137 [details]
Possible solution (?)

For some reason, the implementation of the "relayout"-method in CoolBar.java is commented out. Replacing it with the current implementation of the SWT/motif-code this file is based upon solves the problem demonstrated by attachment 145420 [details].

However, with these changes two tests in org.eclipse.swt.widgets.CoolItem_Test fail. I checked against WIN/SWT, there they would also fail, but with different results. I'm not yet sure that it will be necessary to change the tests, but otherwise the coolbar works fine with the patch. (Except the known, previously existing problems.)

I also tried restoring code that is commented out in layoutItems(), but that did not change anything.
Comment 15 Tim Buschtoens CLA 2009-10-09 06:15:50 EDT
Created attachment 149221 [details]
Update for CoolItem tests

Additional patch to update the tests. Checked against SWT/WIN, where the tests would also succeed.
Comment 16 Markus Krüger CLA 2009-10-12 04:17:48 EDT
Hopefully see it CVS soon.
Comment 17 Rüdiger Herrmann CLA 2009-10-12 08:17:40 EDT
Applied patch to CVS HEAD