My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members

We are changing the core of the code now to use CSS3 Display:Box model. Some stuff may not work until notice What is Glex

Glex is a GWT library that aims to provide a simple Events, Layout, and State base system to Google Web Toolkit. It also provides helper classes to allow developers to easy develop layout based UI based on DIV Layout and HTML 5 standards. Glex aims to support both pure java code GWT projects or projects using UiBinder. You can try Glex out but it is currently not recommended for production use

Glex is heavily influenced by Adobe Flex 4's Spark Architecture. Glex is created by Shinchi (shinchi-at-gmail.com ). Note that a lot of Glex code now (particularly in the layout system are still using float instead of CSS3 based layout, this is something that will be changed in the future). Please email me at shinchi-at-gmail.com if you wish to contribute to the project

User Interface

Glex borrows heavily from Flex's Spark Architecture. Its uses the base class "Group" and the basic Layout class to decide its layout. Developers can extends the ILayout class to create their own custom layout

Repeater

Use the Repeater/List UI to render a list of data easily. You can easily customize the layout by using a different Layout class and a different Renderer to render out your items UI .

Sample Code

/**
Flex Developers will find this similar to how Spark works
**/
ArrayList< AlbumVO> albums = 	new ArrayList<AlbumVO>();
		
albums.add(new AlbumVO("http://ecx.images-amazon.com/images/I/61G6ZP6A0PL._SL110_.jpg", "Singles"));
albums.add(new AlbumVO("http://ecx.images-amazon.com/images/I/41EA9W1A40L._SL110_.jpg", "International Hip"));
		
Repeater rp = new Repeater();
rp.setLayout(Layout.VERTICAL);
rp.setRender(new AlbumRenderer());
rp.setData(albums);

Sample Code for UiBinder

Glex aims to support UiBinder syntax. Currently it is supported but limited in some ways

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
	xmlns:s="urn:import:com.expertria.glex.view"
	xmlns:layout="urn:import:com.expertria.glex.view.layout"	 
	xmlns:g="urn:import:com.google.gwt.user.client.ui">
	
	<ui:style>
		.important {
			font-weight: bold;
		}
	</ui:style>
	
	<ui:with field='layout' type='com.expertria.glex.view.layout.VerticalLayout' />
	<ui:with field='myRenderer' type='com.expertria.example.client.repeater.AlbumRenderer' />
        <!-- Act like ArrayCollection in Flex -->
	<ui:with field="data"  type='java.lang.Object'/>
	
	<s:Group   layout="{layout}">


		 <g:Button styleName="{style.important}" ui:field="button" />
		 
		  <!-- Layout in a Vertical Manner -->
		   <s:Repeater  layout="{layout}" data="{data}" renderer="{myRenderer}"  >
	 
		 </s:Repeater>
	 
	</s:Group>
	 
</ui:UiBinder>

Usage

<inherits name='com.expertria.Glex' />

Powered by Google Project Hosting