
Home
.. Links
.. Search
.. Plugins
.. Help
.. Irc Faq
Projects
.. Platform/Faq
.. JDT/Faq/Plan
.. PDE/Faq
.. SWT/Faq
.. RCP/Faq
Tools Projects
.. CDT/Faq
.. GEF/Faq
.. EMF/Faq
Wiki Tutorials
Hosted Projects
.. MTJ
.. Google Summer Of Code 2007
.. Update Manager 2.0
.. EasyEclipse
.. Stylebase for Eclipse
Archives
| |
XSWT describes SWT screen layouts using XML in a way that provides the following benefits: - Approximately 33% reduction in code size over using hand-coded Java. This number comes from comparisons of actual SWT code from Eclipse with hand-coded XSWT replications.
- A more readable and maintainable description of SWT layouts.
- 1:1 mapping between XSWT elements and Java code. If you understand the XSWT rules, all you need to code it is in the SWT JavaDoc.
Here's HelloWorld.xswt: <?xml version="1.0" encoding="UTF-8"?> <xswt xmlns:x="http://sweet_swt.sf.net/xswt"> <x:import> <package name="java.lang"/> <package name="org.eclipse.swt.widgets"/> </x:import> <label text="Hello, world"/> </xswt> Here's a more complex example: <?xml version="1.0" encoding="UTF-8"?> <xswt xmlns:x="http://sweet_swt.sf.net/xswt"> <x:import> <package name="java.lang"/> <package name="org.eclipse.swt.widgets"/> <package name="org.eclipse.swt.layout"/> <package name="com.swtworkbench.community.controls.blotter"/> </x:import> <layout x:class="formLayout"/>
<label x:id="firstColLabel" text="First column"> <layoutData x:class="formData"> <left x:p0="10"/> <top x:p0="5"/> </layoutData> </label> <text x:id="secondCol" text="Second column"> <layoutData x:class="formData"> <left x:p0="firstColLabel" offset="10"/> <top x:p0="firstColLabel" offset="0" alignment="TOP"/> <right x:p0="90"/> </layoutData> </text> <blotter> <layoutData x:class="formData"> <left x:p0="firstColLabel" alignment="LEFT"/> <top x:p0="firstColLabel" offset="10"/> <right x:p0="secondCol" alignment="RIGHT"/> <bottom x:p0="90"/> </layoutData> </blotter> </xswt> (In the example above, the x:p0 meta-attribute specifies the 0th constructor parameter.) In addition, XSWT provides the following features: - An Eclipse plug-in providing everything you need to start coding XSWT: an XML editor, a File/New wizard, and an XSWT Preview view.
- A small XSWT program loader that can be embedded in your applications to load your XSWT-based screens.
- An XSWT to Java compiler so you can compile XSWT source code to Java source code. Have your cake and eat it too. Enjoy the best of the XSWT and Java worlds at the same time!
A XSWT GUI Builder is under the development. A screenshot: 
XSWT can be found at: http://xswt.sourceforge.net/
Last Modified 10/2/06 11:15 AM
| Hide Tools
|