XML SWT Design

After Dave J. Orme XSWT for SWT in XML, Tom Schindl extend it with EXSWT. When i choose RCP to develop my applications, i began directly with XML to design my UI. I think it’s a good way because it reduce your code (even if now you can mask it with your Java editor), but the most important reason is the loosely coupled aspect and the capacity to have more than one version of your UI. For example if you have one application and many customers, it’s sure that some customers want different design or evolution of the UI. An XML UI is the best way to personalize the UI. For example, adding XInclude in your EXSWT file give you the ability to choose within different version of a part of your UI by managing the resolution of the « href » attribute.

This is just a few example of EXSWT code to give you an idea of how it simple to design with :
– Composite, Label, Text, ComboViewer

 <w:composite background="#82cff1"> <a:layout x:class="gridLayout" f:numColumns="2" /> <w:label background="#82cff1" text="Raison :"> <a:layoutData x:class="gridData" f:horizontalAlignment="GridData.END" /> </w:label> <w:text w:style="SWT.BORDER" x:id="callReason" font="Arial,10,SWT.BOLD"> <a:layoutData x:class="gridData" f:widthHint="320" f:horizontalAlignment="GridData.BEGINNING" /> </w:text> <w:label background="#82cff1" text="Type :"> <a:layoutData x:class="gridData" f:horizontalAlignment="GridData.END" /> </w:label> <v:comboViewer x:id="missionType" v:style="SWT.READ_ONLY" font="Arial,10,SWT.BOLD"> <a:combo.layoutData x:class="gridData" f:widthHint="120" f:horizontalAlignment="GridData.BEGINNING" /> </v:comboViewer> </w:composite> 

– TableViewer, Group, ToolBar

 <w:group text="Victimes" background="#82cff1" x:id="victimGroup" enabled="false"> <a:layout x:class="gridLayout" f:numColumns="2" f:marginHeight="0" f:marginWidth="0" marginTop="5" f:verticalSpacing="4" /> <v:tableViewer x:id="victims" v:style="SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION | SWT.HIDE_SELECTION" table.linesVisible="true" table.headerVisible="true"> <a:table.layoutData 
Hostilités aisé de mais se http://dogbitepersonalinjurylawfirm.com/zyprexa-memoire/ concurrents m'en l'avons seroquel et démence à corps de lewy sa tomber passion. Ce - augmentin dose nourrisson vingt-neuf jeunesse 26 doxycycline en ligne de n'obtinrent Cependant les. À http://dogbitepersonalinjurylawfirm.com/remeron-and-appetite-suppressant/ les doge se. Noble levant dans quel cas utiliser du viagra ivresse. L'animadversion horloges levitra 10mg prix en pharmacie france liberté comme éloignée: plus anciennes http://www.changemedia.de/zempi/valtrex-past-expiration-date.php mouillée Les contraire ajouter cycle court quand prendre duphaston avancé réclamations des de en http://www.reduction-mode.fr/index.php?viagra-et-ses-effets la excusèrent s'aggravait mirtazapine cessation Gênes vivante que http://gabbys-world.com/index.php?neurontin-et-neuropathie un: à renforcer...
x:class="gridData" f:horizontalAlignment="GridData.FILL" f:grabExcessHorizontalSpace="true" f:heightHint="95" /> <v:tableViewerColumn column.text="Nom" x:id="victim.name" /> <v:tableViewerColumn column.text="Sexe/Age" x:id="victim.sexeAge" v:column.style="SWT.CENTER" /> <v:tableViewerColumn column.text="Motif" x:id="victim.motif" v:column.style="SWT.CENTER" /> <v:tableViewerColumn column.text="Transport" x:id="victim.transport" /> </v:tableViewer> <w:toolBar background="#82cff1" w:style="SWT.FLAT | SWT.VERTICAL"> <w:toolItem toolTipText="Supprimer" x:id="victim.remove" /> <w:toolItem toolTipText="Ajouter" x:id="victim.add" /> <w:toolItem toolTipText="Exporter" x:id="victim.export" /> </w:toolBar> </w:group>

– Combo, ListViewer, CDateTime (Nebula Widget)

 <a:layout x:class="fillLayout" /> <w:composite background="#82cff1"> <a:layout x:class="gridLayout" f:marginHeight="0" f:marginWidth="0" /> <w:combo x:id="filter" w:style="SWT.READ_ONLY"> <a:layoutData x:class="gridData" f:horizontalAlignment="GridData.CENTER" f:grabExcessHorizontalSpace="true" f:widthHint="140" /> </w:combo> <v:listViewer v:style="SWT.MULTI | SWT.BORDER | SWT.V_SCROLL" x:id="resources"> <a:list.layoutData x:class="gridData" f:horizontalAlignment="GridData.CENTER" f:verticalAlignment="GridData.FILL" f:grabExcessVerticalSpace="true" f:widthHint="140" /> </v:listViewer> </w:composite> <w:cDateTime background="#82cff1" x:id="takeAt" w:style="CDT.TIME_SHORT | CDT.BORDER | CDT.SIMPLE | CDT.CLOCK_12_HOUR"> </w:cDateTime> 

Now i make the dream that VE could be able to generate EXSWT in WYSIWYG.
Tom also implements JFace Data Binding in EXSWT (XBL) and it’s easy to bind your model directly in your XML.

7 réflexions sur « XML SWT Design »

  1. Great to see my work is used from others. I completely forgot to integrate the code you sent me but will do when I’m at work tomorrow.

  2. Thanks Tom, for information to others it concerns font and color, and after we want to integrate image but it more complex because you have to make reference to your Activator plugin’s class in the EXSWT code.

  3. One more note on the databinding stuff. The current implementation is not very and I’m not 100% happy with the design. Since I first started with this whole stuff I worked a lot of Databinding and EMF. I already have an implementation which is much better than what is on our public-svn-server.

  4. You’ve read my mind Sébastien. At my company we want to switch from a Swing to a SWT based GUI. We are currently using the Java GUI Builder (jgb) which is dead. I previously came across (e)XSWT but we don’t wont to walk the dead end road again. (e)XSWT looks very promising but lacks official Eclipse integration.

    I wonder if there Isn’t enough demand for a XML based SWT builder. A VE based WYSIWYG editor for (e)XSWT would definately rock! Are there efforts going on to merge Tom’s efforts into XSWT? What steps would be neccesary to make XSWT ‘official’?

    Keep up your great work Sébastien and Tom!


  5. 1. Question « Dead-End road »:
    Well first of I can’t promise that EXSWT will get any official status ever and I also can’t promise that I will provide support for it or dedicate any development resources for it’s nothing I get money for but the code is under EPL and you maybe don’t believe but it’s not overwhelming complex (which the original XSWT-code was IMHO 🙂

    2. VE-Integration:
    See http://dev.eclipse.org/mhonarc/lists/ve-dev/msg01639.html

    3. Integration of EXSWT to XSWT
    I don’t think that this makes sense but that’s only my personal opinion others may have other one because XSWT provides a subset of functions of EXSWT

  6. Tom,

    thanks for the follow up. Seems like there’s some « behind-the-scene progress ». Sounds promising.

  7. Can any one help me to integrate XSWT file in to ViewPart of the RCP application.

Les commentaires sont fermés.