Software:
News ToolsReg Shops |
Echo2 versus GWTAnother toolkit that hides AJAX's implementation detailsPublished Thursday 24th August 2006 13:29 GMT The HelloWorldApp is an extremely small application that is intentionally simple. However, from it you should be able to get a flavour of the AWT/Swing style of the Echo2 framework. In this class we have an init() method. This method creates a new instance of a Window (which is the object returned by the method). We then create a content pane that is added to the window, and a pane to hold our graphical components - a Label and a Button. Note that the root of the Echo world is EchoServer, which must return an instance of EchoInstance. Each session has its own EchoInstance object. From this point on, everything is programmed in terms of Java classes such as Window, Label, Button, Table etc. Also note that to implement the button behaviour all I have to do is write a standard-looking ActionListener, which will toggle the message displayed by the label. To deploy this example application we must create a WAR file containing the Echo2 library jars () and a web.xml file to define our web application to our Web Application Server (in my case, this is Tomcat). Once this is done, I can reference the URL for the web application created by Echo and display the result as illustrated in Figure 1.
In Figure 1, this very simple screen alternates between a "Hello World" message and a "Hello Echo World" message each time the "Next" button is clicked, showing that the Java based classes presented above have been dynamically translated into JavaScript, HTML etc., as and when required. The range of GUI components supplied by Echo2 is not limited to labels and buttons, of course; the full set includes components for:
In addition, the Echo2 Extras project adds TabbedPanes, Calendar Selector, Colour Selector, a Pull down menu component etc. A range of other contributed libraries provides further enhancements such as:
Track this type of story as a custom Atom/RSS feed or by email.
|
|
||||||||
Top 20 stories • All The Week’s Headlines • Archive • Search