VulComposer
An XML layout composer and auto-wire library for Vaadin
VulComposer is an auto-wiring composer that lets you layout Vaadin containers and components in VUL (XML) format.
Simply extend VulComposer and supply a getVulName() function, and the composer will create and layout your components according to the supplied VUL file. The composer will also auto-wire created components to those declared in your class, and will auto-wire event methods based on a simple naming convention.
Sample code
<?xml version="1.0"?> <window caption="Test Window" width="200" scrollable="false" resizable="true" x="200" y="100"> <verticallayout sizefull="true" spacing="true" margin="bottom"> <verticallayout orientation="horizontal" spacing="true" margin="top,left,right"> <textfield id="testText" caption="test" width="100%"/> <textfield id="otherText" caption="other" width="100%"/> </verticallayout> <horizontallayout width="100%" alignment="bottom center" spacing="true"> <horizontallayout spacing="true" alignment="middle center"> <button id="testBtn" caption="test"/> <button id="otherBtn" caption="other"/> </horizontallayout> </horizontallayout> </verticallayout> </window>
package com.example.boilerplate; import com.vaadin.Application; import com.vaadin.ui.*; import org.sevenless.vul.VulComposer; public class TestComposer extends VulComposer { TextField testText; TextField otherText; Button testBtn; Button otherBtn; public TestComposer(Application app) throws Exception { super(app); } public String getVulName() { return "vul/example.vul"; } public void onClick$testBtn(Button.ClickEvent event) { testText.setValue("works"); } public void onClick$otherBtn(Button.ClickEvent event) { otherText.setValue("works too"); } }
... TestComposer tc = new TestComposer(this); mainWindow.addWindow((Window)tc.getRootContainer()); ...
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
- Released
- 2010-08-10
- Maturity
- EXPERIMENTAL
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 6.4+
- Browser
- Browser Independent
VulComposer - Vaadin Add-on Directory
An XML layout composer and auto-wire library for VaadinVulComposer is an auto-wiring composer that lets you layout Vaadin containers and components in VUL (XML) format.
Simply extend VulComposer and supply a getVulName() function, and the composer will create and layout your components according to the supplied VUL file. The composer will also auto-wire created components to those declared in your class, and will auto-wire event methods based on a simple naming convention.
Author HomepageDocumentation
Issue Tracker
Source Code