Wednesday, May 11, 2011

swinghtmltemplate 0.5 released

New release 0.5 is available for swinghtmltemplate project.

Check an updated documentation, download jars or add this to maven:

<dependencies>
        <dependency>
            <groupId>com.googlecode.swinghtmltemplate</groupId>
            <artifactId>swinghtmltemplate</artifactId>
            <version>0.5</version>
        </dependency>
    </dependencies>


    <repositories>
        <repository>
            <id>swinghtmltemplate</id>
            <name>Swing html template repo</name>
            <url>http://swinghtmltemplate.googlecode.com/svn/maven-repository</url>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>




In new release i18n support added. To use it add ui:loadBundle tag to you html:
<html xmlns:j="http://www.oracle.com/swing"
      xmlns:ui='http://swinghtmltemplate.googlecode.com/ui'>

<head>
    <ui:loadBundle baseName="ru.swing.html.example.tabsform" var='msg' locale='en_EN'/>
</head>

<body display="border">

<div id="rootPanel" style="display:border">

<j:tabs>
    <div title="${msg.tab1_title}">
        <p>${msg.tab1_text}</p>
    </div>

    <div title="${msg.tab2_title}">
        <j:scroll style='border: titled "${msg.tab2_jeditorpane}"'>
            <object classid="javax.swing.JEditorPane"></object>
        </j:scroll>

    </div>
</j:tabs>
</div>
</body>
</html>


this loads ResourceBundle from ru/swing/html/example/tabsform.properties.


The placeholders for each attribute are available. Placeholder is the same as EL, but is evaled only when attribute is applied to component (during conversion phase or when manually invoking the `applyAttrinute()`) and is not binded to the specified value.

As you can see in previous example the i18n is done with placeholders.


ui:component is added in this release. You can use it the same way as in facelets.

Initial configuration support is added to the dom model. Some methods were implemented as services and moved o configuration, so you can override them.

New api for querying tags were added. Read more on this here

No comments :

Post a Comment