Community
Participate
Working Groups
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.
Can you provide a snippet to reproduce the problem?
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
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.
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.
Created attachment 136991 [details] correctToolbar.gif
Created attachment 136992 [details] incorrectToolbar1.gif
Created attachment 136993 [details] incorrectToolbar2.gif
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.
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...
Maybe bug: 237268 is related to this one, too???
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
Could not reproduce the problem with the snippet.
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.
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.
Created attachment 149221 [details] Update for CoolItem tests Additional patch to update the tests. Checked against SWT/WIN, where the tests would also succeed.
Hopefully see it CVS soon.
Applied patch to CVS HEAD