Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 15:01 Go to next message
Mar Ifla is currently offline Mar Ifla
Messages: 22
Registered: September 2013
Junior Member
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 15:02]

Report message to a moderator

Re: Relative width of Parts in PartSashContainer - containerData has no effect [message #1115769 is a reply to message #1115768] Tue, 24 September 2013 15:05 Go to previous messageGo to next message
Sopot Cela is currently offline Sopot Cela
Messages: 597
Registered: December 2010
Senior Member

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 15:06 Go to previous messageGo to next message
romain ognier is currently offline romain ognier
Messages: 18
Registered: September 2013
Junior Member
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 15:29 Go to previous messageGo to next message
Mar Ifla is currently offline Mar Ifla
Messages: 22
Registered: September 2013
Junior Member
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 15:32 Go to previous messageGo to next message
romain ognier is currently offline romain ognier
Messages: 18
Registered: September 2013
Junior Member
<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 16:05 Go to previous messageGo to next message
Mar Ifla is currently offline Mar Ifla
Messages: 22
Registered: September 2013
Junior Member
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 16:06]

Report message to a moderator

Re: Relative width of Parts in PartSashContainer - containerData has no effect [message #1115816 is a reply to message #1115813] Tue, 24 September 2013 16:07 Go to previous messageGo to next message
Sopot Cela is currently offline Sopot Cela
Messages: 597
Registered: December 2010
Senior Member

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 16:31 Go to previous messageGo to next message
Mar Ifla is currently offline Mar Ifla
Messages: 22
Registered: September 2013
Junior Member
efxc
Re: Relative width of Parts in PartSashContainer - containerData has no effect [message #1115907 is a reply to message #1115828] Tue, 24 September 2013 19:20 Go to previous messageGo to next message
Eric Moffatt is currently offline Eric Moffatt
Messages: 118
Registered: July 2009
Senior Member

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 20:58 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5296
Registered: July 2009
Senior Member
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 22:37 Go to previous message
Mar Ifla is currently offline Mar Ifla
Messages: 22
Registered: September 2013
Junior Member
Thanks! Smile
Previous Topic:Exporting an OSGi Application Project
Next Topic:Can't load library: i386/libglass.so
Goto Forum:
  


Current Time: Wed Sep 03 02:22:23 GMT 2014

Powered by FUDForum. Page generated in 0.02480 seconds