Skip to main content



      Home
Home » Eclipse Projects » e(fx)clipse » Relative width of Parts in PartSashContainer - containerData has no effect
Relative width of Parts in PartSashContainer - containerData has no effect [message #1115768] Tue, 24 September 2013 11:01 Go to next message
Eclipse UserFriend
I'm creating a RCP e4 application product and want to set the initial width of two Parts in a horizontal PartSashContainer.

I read about just setting the containerData attribute of the Parts, e.g. "20" and "80" for a 20% to 80% relation. I'm just doing this but it doesn't have any effect on the actual rendering. The Parts have equal widths.

That's the appropriate code in the XMI:
<children xsi:type="basic:PartSashContainer" xmi:id="_YtXj4CUhEeO-E52C3JQ7OQ" elementId="my.partsashcontainer" containerData="" selectedElement="_-W9m8CUXEeO-E52C3JQ7OQ" horizontal="true">
      
	<children xsi:type="basic:Part" xmi:id="_-W9m8CUXEeO-E52C3JQ7OQ" elementId="my.part1" containerData="20" contributionURI="bundleclass://my.app/my.part1" label="Part1"/>
      
	<children xsi:type="basic:Part" xmi:id="_joYXsCE2EeO-E52C3JQ7OQ" elementId="my.part2" containerData="80" contributionURI="bundleclass://my.app/my.part2" label="Part2"/>
    
</children>


(The product is an org.eclipse.fx.ui.workbench.application, if that's of any interest.)


[Updated on: Tue, 24 September 2013 11:02] by Moderator

Re: Relative width of Parts in PartSashContainer - containerData has no effect [message #1115769 is a reply to message #1115768] Tue, 24 September 2013 11:05 Go to previous messageGo to next message
Eclipse UserFriend
Try the clearpersistedstate flag http://www.vogella.com/articles/EclipseRCP/article.html#runconfigurationpara
Re: Relative width of Parts in PartSashContainer - containerData has no effect [message #1115772 is a reply to message #1115768] Tue, 24 September 2013 11:06 Go to previous messageGo to next message
Eclipse UserFriend
Or put the part in partStak and set the containerData of the PartStack and it should work.
Re: Relative width of Parts in PartSashContainer - containerData has no effect [message #1115792 is a reply to message #1115772] Tue, 24 September 2013 11:29 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for your quick answers, but none of the approaches has an effect. Sad
Re: Relative width of Parts in PartSashContainer - containerData has no effect [message #1115796 is a reply to message #1115792] Tue, 24 September 2013 11:32 Go to previous messageGo to next message
Eclipse UserFriend
<children xsi:type="basic:PartSashContainer" xmi:id="_YtXj4CUhEeO-E52C3JQ7OQ" elementId="my.partsashcontainer" containerData="" selectedElement="_-W9m8CUXEeO-E52C3JQ7OQ" horizontal="true">   
<children xsi:type="basic:PartStack" xmi:id="_uYGxoxYxEeOeFd4ezZn-XA" elementId="my.parstackt1" containerData="20">  
	<children xsi:type="basic:Part" xmi:id="_-W9m8CUXEeO-E52C3JQ7OQ" elementId="my.part1" containerData="" contributionURI="bundleclass://my.app/my.part1" label="Part1"/>    
</children>  
<children xsi:type="basic:PartStack" xmi:id="_uYGxoxYxEeOeFd4ezZn-XA" elementId="my.parstackt2" containerData="80">  
	<children xsi:type="basic:Part" xmi:id="_joYXsCE2EeO-E52C3JQ7OQ" elementId="my.part2" containerData="" contributionURI="bundleclass://my.app/my.part2" label="Part2"/>    
</children> 
</children>


It works for me.
Re: Relative width of Parts in PartSashContainer - containerData has no effect [message #1115813 is a reply to message #1115796] Tue, 24 September 2013 12:05 Go to previous messageGo to next message
Eclipse UserFriend
That's what I feared. Sad

I just had a look at the sample project from E(fx)clipse Tutorial 4 which has a similar application model.

PartSashContainer
-Part(containerData="0.3")
-Part Stack(containerData="0.7")

If I run the project, the Part and the Part Stack have nearly equal size, the ratio is roughly 45% to 55%.

Why doesn't this work in my environment?

I'm using Eclipse Kepler with e(fx)clipse IDE 0.9.0.201309190708 and e4 Tools 0.14.0.v20130814-1230 with jdk1.7.0_25 on Windows 7 64bit.

[Updated on: Tue, 24 September 2013 12:06] by Moderator

Re: Relative width of Parts in PartSashContainer - containerData has no effect [message #1115816 is a reply to message #1115813] Tue, 24 September 2013 12:07 Go to previous messageGo to next message
Eclipse UserFriend
Are you using SWT or efxc renderers? If it's the second I'll move this to the efxc forum.
Re: Relative width of Parts in PartSashContainer - containerData has no effect [message #1115828 is a reply to message #1115816] Tue, 24 September 2013 12:31 Go to previous messageGo to next message
Eclipse UserFriend
efxc
Re: Relative width of Parts in PartSashContainer - containerData has no effect [message #1115907 is a reply to message #1115828] Tue, 24 September 2013 15:20 Go to previous messageGo to next message
Eclipse UserFriend

Also, if the sum of the widths is too small you'll see choppy drag behavior because changing the value from '80' to '75' for example will cover many more than 5 pixels.

Generally you should keep the totals fairly high (i.e. we'd use 8,000 / 2,000 as the sum so that we have plenty of room rather than 80 / 20.
Re: Relative width of Parts in PartSashContainer - containerData has no effect [message #1115977 is a reply to message #1115828] Tue, 24 September 2013 16:58 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

OK - this is a freaking FX-SplitPane problem. The reason is that the
first layouting happens BEFORE the stage is show and has a size.

Now when we try to apply the sash weights can not be smaller than the
minimal content and because of that the split is roughly 50:50.

I've filed https://bugs.eclipse.org/bugs/show_bug.cgi?id=417965 and
fixed it with
http://git.eclipse.org/c/efxclipse/org.eclipse.efxclipse.git/commit/?id=b7bdb71360564bc2aba13ba5eaf54c5000cb6d6f
so the next nightly build should hold it. You don't need to update the
tooling BUT you need to reset your target-platform to the nightly build.

Tom

On 24.09.13 18:31, Mar Ifla wrote:
> efxc
Re: Relative width of Parts in PartSashContainer - containerData has no effect [message #1116025 is a reply to message #1115977] Tue, 24 September 2013 18:37 Go to previous message
Eclipse UserFriend
Thanks! Smile
Previous Topic:Exporting an OSGi Application Project
Next Topic:Can't load library: i386/libglass.so
Goto Forum:
  


Current Time: Wed May 07 08:45:52 EDT 2025

Powered by FUDForum. Page generated in 0.05475 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top