| <?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">
|
|
|
| <shell text="This is a shell" var="shell" size="600,300" style="border, close, min, max, resize, title">
|
| <menu style="bar">
|
| <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"/>
|
| <menuItem style="separator"/>
|
| <menuItem text="Save"/>
|
| </menu>
|
| </menuItem>
|
| <menuItem text="Help" style="cascade">
|
| <menu>
|
| <menuItem text="About"/>
|
| </menu>
|
| </menuItem>
|
| </menu>
|
|
|
| <gridLayout/>
|
|
|
| <group text="Some form">
|
| <gridData style="fill_horizontal"/>
|
|
|
| <gridLayout numColumns="2"/>
|
| <label text="Hello" style="horizontal, shadow_in"/>
|
| <text var="textField" text="1234" editable="true">
|
| <gridData style="fill_horizontal"/>
|
| </text>
|
| </group>
|
|
|
| <table
|
| headerVisible="true"
|
| linesVisible="true"
|
| toolTipText="This is a table!"
|
| style="multi, border, full_selection">
|
|
|
| <gridData style="fill_both"/>
|
|
|
| <tableColumn text="Name" width="100" />
|
| <tableColumn text="Age" width="40" />
|
|
|
| <!-- 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 style="vertical">
|
| <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>
|
| <toolItem text="Tree" toolTipText="Starts the Tree demo">
|
| <onEvent type="Selection">
|
| <j:include uri="tree.jelly"/>
|
| </onEvent>
|
| </toolItem>
|
| <toolItem text="TableTree" toolTipText="Starts the TableTree demo">
|
| <onEvent type="Selection">
|
| <j:include uri="tableTree.jelly"/>
|
| </onEvent>
|
| </toolItem>
|
| <toolItem text="Parent Demo" toolTipText="Starts the Parent Demo that shows how to start a component given a parent widget">
|
| <onEvent type="Selection">
|
| <j:include uri="parentDemo.jelly"/>
|
| </onEvent>
|
| </toolItem>
|
| <toolItem text="Style Defaulting Demo" toolTipText="Shows how default styles can be used, rather than always specifying the styles">
|
| <onEvent type="Selection">
|
| <j:include uri="styleDefaultDemo.jelly"/>
|
| </onEvent>
|
| </toolItem>
|
| </toolBar>
|
| </shell>
|
|
|
| <!-- we could abstract the following away as a tag -->
|
|
|
| <!--
|
| ${shell.pack()}
|
| -->
|
| ${shell.open()}
|
|
|
| <j:set var="display" value="${shell.display}"/>
|
|
|
| <j:while test="${!shell.isDisposed()}">
|
| <j:if test="${!display.readAndDispatch()}">
|
| <j:set var="foo" value="${display.sleep()}"/>
|
| </j:if>
|
| </j:while>
|
| ${display.dispose()}
|
| </j:jelly>
|