Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 378752

Summary: Missing ToolItem and ToolItems Not Correctly Sized
Product: [RT] RAP Reporter: Scott Helsby <scott.helsby>
Component: WorkbenchAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: elias, gmalary, ivan, jyan, ronald.so
Version: 1.5   
Target Milestone: 2.0 M1   
Hardware: PC   
OS: Windows NT   
Whiteboard: sr151
Attachments:
Description Flags
ZIP file containing simple project reproducing issue
none
Excessive space next to the rightmost menu item. none

Description Scott Helsby CLA 2012-05-07 17:01:53 EDT
Build Identifier: 1.5.0.20120320-1638

The first time our Window comes up, our tool-bar initially shows all of the expected tool-items, but there is a size recalculation and the last tool-item disappears and the other tool-items are cut-off on their bottom edge and each of the tool-items is overlapping the expected separation between it and the next item as well as the next items's left edge.

If an editor that has an action-bar-contributor is opened, the tool-items are repositioned correctly.

If a second session is started, the tool-items are also displayed correctly.

Reproducible: Always
Comment 1 Scott Helsby CLA 2012-05-07 17:03:08 EDT
Created attachment 215217 [details]
ZIP file containing simple project reproducing issue
Comment 2 Ivan Furnadjiev CLA 2012-05-08 05:15:45 EDT
I can reproduce the issue. It seems that during the text size determination that workbench window toolbar/coolbar is not resized/re-layouted.
Comment 3 Ivan Furnadjiev CLA 2012-07-06 05:22:09 EDT
*** Bug 380001 has been marked as a duplicate of this bug. ***
Comment 4 George R Malary CLA 2012-07-06 10:08:54 EDT
Is this going to be changed to a P1 issue since it is a regression, like the issue 30001 that was closed as a duplicate?  Also, I will add my colleagues to the CC list.
Comment 5 Ivan Furnadjiev CLA 2012-07-06 10:27:23 EDT
(In reply to comment #4)
> Is this going to be changed to a P1 issue since it is a regression.
Sure.
Comment 6 Ronald So CLA 2012-07-06 11:44:06 EDT
I see the same problem in my UI when I run it in Simplified Chinese.  We are using dynamic menu contribution under the org.eclipse.ui.menu extension point.
Comment 7 Ivan Furnadjiev CLA 2012-07-16 07:57:21 EDT
Fixed by adding a resize listener to CoolBarManager#coolBar with commit e2aad947c32a41001604a7b4c29c94ab2ee7b14b.
Comment 8 Ronald So CLA 2012-08-02 15:08:23 EDT
Ivan,

I see the target milestone for this bug fix is marked at 2.0M1.  When will it become available?  Is this fix going to be included in the 1.5.1 release in September?

Thanks,
Ronald
Comment 9 Ivan Furnadjiev CLA 2012-08-03 03:12:53 EDT
(In reply to comment #8)
> I see the target milestone for this bug fix is marked at 2.0M1.  When will
> it become available?  Is this fix going to be included in the 1.5.1 release
> in September?
The 2.0M1 build is scheduled for 24.08.2012. I think that the fix is safe to be backported to 1.5. 1.5 SR1 is planned for 24.09.2012.
Comment 10 Ronald So CLA 2012-08-07 10:48:52 EDT
Thanks for the info, Ivan.  We may have to live with RAP 1.5 in our current release.  At this point, it is okay to use RAP nightly build.  Do you have an idea when I can download the RAP nightly build that contains this fix?

Thanks so much.

Ronald
Comment 11 Ivan Furnadjiev CLA 2012-08-07 10:55:41 EDT
(In reply to comment #10)
> Thanks for the info, Ivan.  We may have to live with RAP 1.5 in our current
> release.  At this point, it is okay to use RAP nightly build.  Do you have
> an idea when I can download the RAP nightly build that contains this fix?

Use RAP Runtime nightly repo or zip from the RAP download page:
http://www.eclipse.org/rap/downloads/
Comment 12 Ronald So CLA 2012-08-07 15:33:07 EDT
Ivan,

I checked in Hudson and the train is moving to 2.0.0 base.  At this point I may not be able to use RAP 2.0.0 as my target platform as we are entering a critical stage of development cycle.  Is there a place where I can download RAP 1.5 target with whatever fixes that go to that branch, including the fix you have for tool item?

Thanks,
Ronald
Comment 13 Ivan Furnadjiev CLA 2012-08-08 02:16:01 EDT
(In reply to comment #12)
> Ivan,
> 
> I checked in Hudson and the train is moving to 2.0.0 base.  At this point I
> may not be able to use RAP 2.0.0 as my target platform as we are entering a
> critical stage of development cycle.  Is there a place where I can download
> RAP 1.5 target with whatever fixes that go to that branch, including the fix
> you have for tool item?

Probably the fix will be included in 1.5 SR1 (24 September). If this is too late for you, get the RAP source from 1.5 maintenance branch and patch it with the commit from comment#7.
Comment 14 Ronald So CLA 2012-08-08 15:25:34 EDT
Ivan,

Is this the branch that you are talking about?

https://hudson.eclipse.org/hudson/job/rap-1.5-runtime/741/

Thanks,
Ronald
Comment 15 Ivan Furnadjiev CLA 2012-08-09 05:10:16 EDT
(In reply to comment #14)
> https://hudson.eclipse.org/hudson/job/rap-1.5-runtime
This is the nightly build of RAP 1.5 maintenance branch. The fix is not ported yet there (when it is available there a comment on the bug will state this). If you want to port it yourself, checkout the RAP runtime source code (streams/1.5-maintenance branch) from Git repo (http://www.eclipse.org/rap/source/) and apply the commit e2aad947c32a41001604a7b4c29c94ab2ee7b14b.
Comment 16 Ronald So CLA 2012-09-07 13:42:10 EDT
Hi Ivan ... just checking in to confirm if the fix has gone / will go in to 1.5.1.  This bug is highly visible and we are getting close to release our product.  Thanks!
Comment 17 Ralf Sternberg CLA 2012-09-10 04:17:13 EDT
+1 to backport to 1.5
Comment 18 Ivan Furnadjiev CLA 2012-09-10 04:56:37 EDT
Backport the fix to 1.5 maintenance branch with commit fdadf99c2cce8ebe9ddc7bfe7f429fa64804a614.
Roland, the fix will be included in RAP 1.5 SR1.
Comment 19 Ronald So CLA 2012-09-30 16:02:28 EDT
Ivan,

I have downloaded the latest RAP 1.5.1 platform, but unfortunately I see the same problem.  I am using dynamic contribution method for the toolbar, and I add the toolbar to my composite by calling:

getWindowConfigurer().createCoolBarControl(coolBarComposite)

in a class that extends WorkbenchWindowAdvisor.

Then I use the ui.menus extension point as follow:

   <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            locationURI="toolbar:org.eclipse.ui.main.toolbar">
         <toolbar
               id="toolbar.perspectiveDynamic">
            <dynamic
                  class="com.syncsort.dp.xsb.ui.application.toolbars.PerspectiveSwitcherLeftToolbar"
                  id="perspectiveSwitcherToolbar">
            </dynamic>
         </toolbar>
      </menuContribution>
   </extension>

The "PerspectiveSwitcherLeftToolbar" extends ContributionItem and create the tool items then add them to the toolbar via the "fill" method.

With the latest 1.5.1 drop, I still see some excessive white space on the right side of the rightmost menu item.  The problem goes away when I log in the second time.  I will attach an image right after this.

Please advice.
Comment 20 Ronald So CLA 2012-09-30 16:03:18 EDT
Created attachment 221702 [details]
Excessive space next to the rightmost menu item.
Comment 21 Ivan Furnadjiev CLA 2012-09-30 16:41:02 EDT
(In reply to comment #19)
Hi Roland, I think that this is a completely different issue. Please open a separate bug and attach a snippet to reproduce the problem. Thanks.