blob: 00ef8766314ed6bb8ea99baae62b018ea17f3b90 [file] [log] [blame]
<?xml version="1.0"?>
<!--
Copyright 2002-2004 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<j:jelly xmlns:j="jelly:core" xmlns="jelly:swt" xmlns:log="jelly:log">
<!--
|| A demo which shows some default styles being used rather than explicitly
|| specifying them for each widget
-->
<shell text="This is a shell" var="subShell">
<menuBar>
<menuItem text="File" style="cascade">
<menu>
<menuItem text="New">
<onEvent type="Selection">
<log:info>Selected New option with event ${event}</log:info>
</onEvent>
</menuItem>
<menuItem text="Open"/>
<menuSeparator/>
<menuItem text="Save"/>
</menu>
</menuItem>
<menuItem text="Help" style="cascade">
<menu>
<menuItem text="About"/>
</menu>
</menuItem>
</menuBar>
<gridLayout/>
<group text="Some form">
<gridData style="fill_horizontal"/>
<gridLayout numColumns="2"/>
<label text="Hello"/>
<text var="textField" text="1234" editable="true">
<gridData style="fill_horizontal"/>
</text>
</group>
<table
headerVisible="true"
linesVisible="true"
toolTipText="This is a table!">
<gridData style="fill_both"/>
<tableColumn text="Name" width="100" toolTipText="This is the name column"/>
<tableColumn text="Age" width="40" toolTipText="This is the age column"/>
<!-- we'd normally use some Java bean model to implement the next bit -->
<tableItem var="row"/>
${row.setText(0, 'James')}
${row.setText(1, '33')}
<tableItem var="row"/>
${row.setText(0, 'Bob')}
${row.setText(1, '30')}
</table>
<toolBar>
<toolItem text="Click Me" toolTipText="I am a ToolBar Item that you can click">
<onEvent type="Selection">
<log:info>Clicked button with event ${event} and text field contains ${textField.text}</log:info>
</onEvent>
</toolItem>
</toolBar>
</shell>
<!-- we could abstract the following away as a tag -->
${subShell.pack()}
${subShell.open()}
</j:jelly>