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

Bug 85899

Summary: [Perspectives] [RCP]Standalone view does not divide space in proper ratio with reference when added to IPageLayout with showTitle parameter false
Product: [Eclipse Project] Platform Reporter: Raj Saini <rajsaini>
Component: UIAssignee: Nick Edgar <n.a.edgar>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: dev, dpwegener, michaelvanmeekeren, mlists, pwebster, sxenos
Version: 3.1Keywords: helpwanted
Target Milestone: 3.1.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 118659    
Bug Blocks:    
Attachments:
Description Flags
StandaloneView added at the bottom with showTitle parameter set to true
none
StandaloneView added at the bottom with showTitle parameter set to td false
none
Screenshot of Mail-App-Sample generated with Eclipse 3.1M6 RCP Wizard
none
Proposed patch none

Description Raj Saini CLA 2005-02-19 09:28:18 EST
When a StandaloneView is added to a IPageLayout withaddStandaloneView((String
viewId, boolean showTitle, int 
 relationship, float ratio, String refId) method call, it does not divide space
in  proper ratio with reference part.

I attch two screenshots one with showTile set to true and other set to false. In
the screenshots the ration to top view is 0.95f. When showTitle is set to true,
space is divided between two views properly. But when showTitle is false, the
bottom view (in screenshot) get more space then it should.
Comment 1 Raj Saini CLA 2005-02-19 09:29:54 EST
Created attachment 18121 [details]
StandaloneView added at the bottom with showTitle parameter set to true
Comment 2 Raj Saini CLA 2005-02-19 09:30:40 EST
Created attachment 18122 [details]
StandaloneView added at the bottom with showTitle parameter set to td false
Comment 3 Conny Kreyssel CLA 2005-04-22 03:31:39 EDT
Created attachment 20226 [details]
Screenshot of Mail-App-Sample generated with Eclipse 3.1M6 RCP Wizard

This screenshot also shows the problem that the standalone view does not access
the full size of the view.

The sample app is generated with the plugin wizard in 3.1M6 (RCP Mail
template). When you maximize the window than this behavior occurs.
Comment 4 Conny Kreyssel CLA 2005-04-22 03:52:37 EDT
See comment above.

If you move the divider between the two views then the left standalone view gets
the correct full size of the underlying part.
Comment 5 Nick Edgar CLA 2005-04-22 10:52:24 EDT
Yes, probably a dup of bug 85654, but I'll leave it open just in case.
Comment 6 Conny Kreyssel CLA 2005-04-25 04:00:56 EDT
Do you have this fixed in CVS?
Comment 7 Nick Edgar CLA 2005-04-25 10:38:26 EDT
No, not yet.
Comment 8 Nick Edgar CLA 2005-05-06 12:07:35 EDT
This is a dup.


*** This bug has been marked as a duplicate of 85654 ***
Comment 9 David Wegener CLA 2005-07-02 00:02:02 EDT
The behavior that was described in the initial bug report is still occuring in 
the 3.1 final release.  The problem is that the initial size assigned to a 
stand alone view is much more than it should be.  If you look closely at the 
first two image attachments, you will notice the the size assigned when 
showTitle is false is 3-4 times the size assigned when showTitle is true.

I am encountering the same behavior in an RCP application that I am 
developing.  The stand alone view without the view tab is 3-4 times the size 
of a view with a view tab.  Also, you are not able to make the view without 
the tab smaller.  The divider bar won't move any farther down.

This seems to be a problem with the minimum size that is being calculated for 
the view without the view tab.
Comment 10 David Wegener CLA 2005-07-02 01:04:52 EDT
After doing some tracing, it appears as though 
TabbedStackPresentation.computePreferedSize is calling 
EmptyTabFolder.computSize.  The EmptyTabFolder is calculating the size on 
childControl.  However, this Control doesn't have any children which results 
in a size of 0,0 being calculated.  This gets converted to the DEFAULT_WIDTH 
of 64 and DEFAULT_HEIGHT of 64.  The result is that the prefered size gets set 
to 64 and you can't reduce the size below this value.

The childControl that is being used appears to be the wrong Control.  
EmptyTabFolder has a Composite called control that appears to contain the view 
components.  Should the size be based on control instead of childControl?
Comment 11 Nick Edgar CLA 2005-07-04 10:14:06 EDT
Reopening and marking for consideration in 3.1.1.
Comment 12 Michael Van Meekeren CLA 2005-09-12 10:34:51 EDT
after the investigation in comment #10, would you be able to provide a patch
with your suggested fix?  If not I don't see this happening for 3.1.1
Comment 13 Karice McIntyre CLA 2005-09-16 13:15:38 EDT
If a patch is going to be provided, is should be released before the RC2 build 
on Sept 23rd.  After that, the likelihood of this being fixed for 3.1.1 
decreses significantly.
Comment 14 David Wegener CLA 2005-09-18 18:03:58 EDT
I was never able to solve the problem.  My initial thoughts of using control
instead of child control didn't work.  I got stuck in a native call to
getChildren or something similar.  I'm not sure how to debug into native calls.  
Comment 15 Michael Van Meekeren CLA 2005-09-19 09:19:18 EDT
Marking as 3.2
Comment 16 Nick Edgar CLA 2005-11-30 11:47:19 EST
Filed bug 118659 for issues with Composite.computeSize (the 64x64 default) and issues encountered with GridLayout.computeSize while investigating an attempted fix to this bug using a GridLayout with 0 margins on the contentProxy in PresentablePartFolder.

Comment 17 Nick Edgar CLA 2005-11-30 12:03:17 EST
Created attachment 30876 [details]
Proposed patch
Comment 18 Nick Edgar CLA 2005-11-30 12:07:01 EST
Stefan, would you be able to review this patch?  It's not ideal, but I can't think of a better way to work around the limitations of Composite.computeSize, other than maybe subclassing it.  But I'm not sure if having a specialized implementation for the content proxy in PresentablePartFolder would work in general.
Comment 19 Nick Edgar CLA 2005-12-13 16:19:33 EST
I'd like to put this into 3.1.2.
Comment 20 Michael Van Meekeren CLA 2005-12-14 10:38:40 EST
don't see any comments from Stefan yet.  Paul could you also take a look at this patch?
Comment 21 Paul Webster CLA 2005-12-14 11:36:01 EST
I've run a couple of tests on 3.1.2, the patch is pretty straight forward and fixes the problem.

If the tests all run, I'd say release the patch.

PW
Comment 22 Nick Edgar CLA 2005-12-15 16:59:07 EST
I've released the patch in both the 3.1.2 and 3.2 (HEAD) streams.
Comment 23 Michael Van Meekeren CLA 2006-01-10 09:49:23 EST
verified on Motif.  I created a simple perspective with a standalone view with and without the title and it takes on the same (correct) size.
Comment 24 Michael Van Meekeren CLA 2006-01-10 09:50:08 EST
that was on Version: 3.1.2 Build id: M20060109-1200 for Motif verification
Comment 25 Nick Edgar CLA 2006-01-10 12:20:39 EST
Verified on Win2K by running modified browser example against build M20060109-1200.