Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XWT » xwt with Sash and FormLayout
xwt with Sash and FormLayout [message #1047665] Tue, 23 April 2013 13:52 Go to next message
Jürgen Weinberger is currently offline Jürgen Weinberger
Messages: 35
Registered: August 2012
Member
Hi!

I have a question regarding a sash and formlayout. I want an control that can be resized with a sash controll. In pure SWT it is no problem but how can i reference another control to bind the FormAttachment too, in xwt?

Here is some source to show what i mean (Here i tried it with just binding the tableviewer to the sash).
Note: That this code doesn't work, its just to show my problem
	<TableViewer Name="MasterTableViewer" x:style="MULTI | FULL_SELECTION | BORDER" input="{Binding path=comments, mode=OneWay}">
	
		...
		
		<TableViewer.table.layoutData>
			<FormData>
				<FormData.top>
					<FormAttachment numerator="0" offset="0"/>
				</FormData.top>
				<FormData.bottom>
					<FormAttachment numerator="100" offset="0"/>
				</FormData.bottom>
				<FormData.left>
					<FormAttachment numerator="0" offset="0"/>
				</FormData.left>
				<FormData.right>
					<FormAttachment offset="0" control="{Binding ElementName=sash, path=control}"/>
				</FormData.right>
			</FormData>
		</TableViewer.table.layoutData>
	</TableViewer>
	
	<Sash x:Name="sash" x:style="VERTICAL">
		<Sash.layoutData>
			<FormData/> 
		</Sash.layoutData>
	</Sash>
	
	<Group text="Summary" background="White">
		<Group.layoutData> 
			<FormData /> 
		</Group.layoutData>

		<Group.layout>
			<GridLayout numColumns="1" horizontalSpacing="5"/>
		</Group.layout>

		....
		
	</Group>


In the last FormAttachment in the tableViewer i try to bind the left side to the sash but i don't know how Smile. I would need the reference to the tableviewer control.

Is this possible ?

thanks for any information and
best regards
Weinma
Re: xwt with Sash and FormLayout [message #1047699 is a reply to message #1047665] Tue, 23 April 2013 14:39 Go to previous message
Erdal Karaca is currently offline Erdal Karaca
Messages: 745
Registered: July 2009
Senior Member
Sash has no property called "control" (Sash.getControl()), i.e. your expression should not contain an additional path (in this case):

<FormData.right>
<FormAttachment offset="0" control="{Binding ElementName=sash}"/>
</FormData.right>

Though, this will bind the right side of your table to the sash.

You should be able to define a reference to your viewer's control as follows:

<TableViewer.table x:name="tvControl" />
Previous Topic:TableViewer selection binding with converter and validation
Next Topic:Using e4 DI in a XWT EventHandler
Goto Forum:
  


Current Time: Tue Sep 23 04:19:24 GMT 2014

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

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