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

Bug 359867

Summary: Change part size dynamically e4-0.10
Product: [Eclipse Project] Platform Reporter: Missing name Mising name <jyl>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: emoffatt, remy.suen, tom.schindl
Version: 4.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Missing name Mising name CLA 2011-10-04 12:17:30 EDT
Hi,

PartSashContainer
Part(id=part1, containerData=10) contains a menu composite
Part(id=part2, containerData=90)

The part1 displays a menu like this
icon1 title1
icon2 title2
icon3 title3


I try to change size of the parts by code to show only icons:
part1 = partService.findPart("part1"); //inject is ok and part1 not null
part2 = partService.findPart("part2"); // part2 not null so it's ok
part1.setContainerData("5");
part1.setContainerData("95");

and changes ... are ignored. Is there a solution to do this by code ?

Thx
Comment 1 Remy Suen CLA 2011-10-04 12:22:07 EDT
Hi, thanks for your bug report. What build of Eclipse 4 are you using?
Comment 2 Missing name Mising name CLA 2011-10-04 15:08:46 EDT
(In reply to comment #1)
> Hi, thanks for your bug report. What build of Eclipse 4 are you using?

Eclipse 4.1
Comment 3 Eric Moffatt CLA 2011-10-05 14:01:48 EDT
At a guess the place where you're setting the containerData to "95" should be against part2 correct ?

If so then changes of this type should indeed be respected so that part1 would only occupy 5% of the space. It's possible that we have code to limit the minimum size though (I remember fixing a defect regarding the Debug view's 'breadcrumb' move involving this).

Note that this won't have any effect on the menu's presentation though, it would only affect the size of the area occupied in the PSC by the two parts...
Comment 4 Missing name Mising name CLA 2011-10-06 14:51:34 EDT
(In reply to comment #3)
> At a guess the place where you're setting the containerData to "95" should be
> against part2 correct ?
> 
> If so then changes of this type should indeed be respected so that part1 would
> only occupy 5% of the space. It's possible that we have code to limit the
> minimum size though (I remember fixing a defect regarding the Debug view's
> 'breadcrumb' move involving this).
> 
> Note that this won't have any effect on the menu's presentation though, it
> would only affect the size of the area occupied in the PSC by the two parts...

Yes,
   part2.setContainerData("95") 
 And my custom menu is a composite of push buttons for example. 

If i put values 5 and 95 in application model and run application, the part size
changes and i only see icons in my part1.
So, why i can't do this by code? Is there something to call after init container data to refresh
Part size?
Comment 5 Eric Moffatt CLA 2011-10-07 14:00:04 EDT
This is almost certainly due to the value of the constant 'minSashPercent' in the SashLayout class.

This was put in specifically to prevent sash areas from being sized to zero.

If this is true then I suspect that even when you set the values in the model any subsequent attempt to drag the sash will result to it 'snapping' to 10%...

Not sure what the right fix is here...we really don't want folks to be able to make stacks too small.
Comment 6 Lars Vogel CLA 2019-11-14 03:51:06 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.