blob: 877c86990024665274d8423b00a82d42ebd67172 [file] [log] [blame]
<Composite xmlns="http://www.eclipse.org/xwt/presentation"
xmlns:x="http://www.eclipse.org/xwt"
xmlns:j="clr-namespace:org.eclipse.xwt.tests.jface.tableviewer.master.detail.list"
x:Class="org.eclipse.xwt.tests.jface.tableviewer.master.detail.list.TableViewer_MasterDetail_NestedTable_AddInput"
DataContext="{StaticResource MyDomain}">
<Composite.layout>
<GridLayout numColumns="2"/>
</Composite.layout>
<Composite.Resources>
<j:Industry x:Key="MyDomain">
<j:Industry.members>
<j:Company Name="Soyatec" >
<j:Company.employees>
<j:Employee Name="Thomas" Age="32"/>
<j:Employee Name="Jin" Age="27"/>
</j:Company.employees>
</j:Company>
<j:Company Name="Thales">
</j:Company>
</j:Industry.members>
</j:Industry>
</Composite.Resources>
<TableViewer Name="IndustryViewer" input="{Binding Path=members}">
<TableViewer.columns>
<TableViewerColumn width="150" text="Name" bindingPath="name"/>
</TableViewer.columns>
<TableViewer.table HeaderVisible="true">
</TableViewer.table>
<TableViewer.control.layoutData>
<GridData horizontalAlignment="FILL" horizontalSpan="2"
grabExcessHorizontalSpace="true"/>
</TableViewer.control.layoutData>
</TableViewer>
<Label text="{Binding ElementName=IndustryViewer,path=singleSelection.(j:Company.name)}">
<Label.layoutData>
<GridData horizontalAlignment="FILL" horizontalSpan="2"
grabExcessHorizontalSpace="true"/>
</Label.layoutData>
</Label>
<TableViewer Name="CompanyViewer1" input="{Binding ElementName=IndustryViewer,Path=singleSelection.(j:Company.employees)}">
<TableViewer.columns>
<TableViewerColumn width="150" text="Name" bindingPath="name"/>
<TableViewerColumn width="150" text="Age" bindingPath="age"/>
</TableViewer.columns>
<TableViewer.table HeaderVisible="true">
</TableViewer.table>
<TableViewer.control.layoutData>
<GridData horizontalAlignment="FILL" verticalAlignment="FILL" heightHint="200"
grabExcessHorizontalSpace="true" grabExcessVerticalSpace="true" />
</TableViewer.control.layoutData>
</TableViewer>
<TableViewer Name="CompanyViewer2" input="{Binding ElementName=IndustryViewer,Path=singleSelection.(j:Company.employees)}">
<TableViewer.columns>
<TableViewerColumn width="150" text="Name" bindingPath="name"/>
<TableViewerColumn width="150" text="Age" bindingPath="age"/>
</TableViewer.columns>
<TableViewer.table HeaderVisible="true">
</TableViewer.table>
<TableViewer.control.layoutData>
<GridData horizontalAlignment="FILL" verticalAlignment="FILL" heightHint="200"
grabExcessHorizontalSpace="true" grabExcessVerticalSpace="true" />
</TableViewer.control.layoutData>
</TableViewer>
<Button name="AddButton" text="Add Employee" SelectionEvent="addEmployee" enabled="{Binding elementName=IndustryViewer,path=singleSelection }" />
</Composite>