Posts

Showing posts from March 13, 2009

Spice up your GWT components with GWT EXT - (read gwit extension)

GWText comes with some great components that spices up your otherwise plain GWT components. Place the 'gwtext.jar' file and include in your project classpath ie. compiler and shell script @java -Xmx256M -cp "%~dp0\src;%~dp0\bin;C:/gwt-windows-1.5.2/gwt-user.jar;C:/gwt-windows-1.5.2/gwt-dev-windows.jar;C:/gwt-windows-1.5.2/gwtext.jar" com.google.gwt.dev.GWTCompiler -out "%~dp0\www" %* com.rsheyeah.gwt.UITest Make sure you have these lines in UITest.gwt.xml file <inherits name='com.gwtext.GwtExt' /> <script src="js/ext/adapter/ext/ext-base.js" /> <script src="js/ext/ext-all.js" /> <stylesheet src="js/ext/resources/css/ext-all.css" /> Lastly, just have the appropriate resource files in their respective js folder Otherwise, the compiler screams "No source code is available for type com.gwtext.client.widgets.form.*****; did you forget to inherit a required module?"

Creating JUnit test cases for your GWT project

The importance of JUnit testing and benchmarking cannot be undermined for java projects, let alone GWT projects. Out-of-box JUnit test support is shipped with GWT for client and server side synchronous and asynchronous testing.Each GWT JUnit test extends GWTTestCase and implements getModuleName() method which defines the interest of GWT module. Hence, if you like to create a project "MyUITest" in eclipse: Go to your GWT_HOME (the place where your gwt related jars reside) directory and in the command prompt, promptly type in projectCreator -eclipse MyUITest and applicationCreator -eclipse MyUITest -out MyUITest com.rsheyeah.gwt.client.UITest and the result is as follows: Created directory MyUITest\src Created directory MyUITest\src\com\rsheyeah\gwt Created directory MyUITest\src\com\rsheyeah\gwt\client Created directory MyUITest\src\com\rsheyeah\gwt\public Created file MyUITest\src\com\rsheyeah\gwt\UITest.gwt.xml Created file MyUITest\src\com\rsheyeah\gwt\public\UITest.html C...