Some background, normally when I start a new project, a designer creates the HTML template, images, and css for it, and then passes it on to me. I then write the javascript and PHP code needed to get the site working.
However I'm considering moving to google web toolkit so I can code the site using Java rather than Javascript/PHP. The obstacle however, is how I would import the designer's HTML and CSS into GWT.
From what I've seen there doesn't seem to be any easy way of doing so? Alternatively if I coded everything in GWT first, and he was able to just style everything using CSS to make them look how he needs them to, that would also work. But would he be able to do that using just css alone?
Any ideas?
We are a one-designer two-programmer team and we have been having a great time with plain UiBinders, no GWT Designer involved. Our process has two basic modes:
The designer writes plain HTML and we convert it to UiBinder later, or
We make the basic UiBinder and he finishes it up with the necessary structure and Css.
We choose either mode based on how the chips fall in our design process. It's really natural and works great.
The designer had to learn:
CssResources (e.g. addStyleNames='{resources.css.style}' instead of class='style')
ImageResources (e.g. adding them to ClientBundles with the GPE)
UiBinder syntax (e.g. <g:TextBox> instead of <input>)
It was pretty natural. The correlation to HTML and CSS is extremely high, and he can transfer his html/css skills directly to UiBinder.
I have no experience with GWT designer, but I see it as another tool in the middle of our process. Maybe it's worth it, but it's not so hard to avoid it. I used an early iteration right after it joined the official GWT repository and it was super obnoxious.
Pay attention to the GWT Designer. It's UI creating wizard that supports GWT. GWT Designer has visual tools to generate a code for you.
Related
Any there web application frameworks without needing to write HTML/UI?
I want to develop a web application from end to end but I am not familiar with HTML/UI, so looking for a Java based framework or tool which generates UI/HTML code automatically without actually writing HTML code (like Eclipse's UI designer plugin).
So can anybody suggest if there are there any tools/plugins to do that?
There cannot be a single correct answer to this question and I agree with the initial comments. However, three technologies that came to mind instantly:
Google Web Toolkit, GWT
Vaadin (based on GWT)
Sencha Touch, you'd have to be familiar with JavaScript though
You can also use the tools such as WYSIWYG (i.e. What You See IS What You Get).
Where without knowledge of ui you can still design ui.
I am quite used to creating user interfaces with HTML/CSS/JS. However, I am working on a JAVA application that utilizes Wicket.
Can anyone point to me anything that shows how to create a ui with Wicket, from a stand point such as mine? If that makes sense. I have been trying to understand how I am going to develop the UI after reading many articles and meeting with our developers. I am just not wrapping my head around how to do it.
Also, from what I know, does it make sense to actually use Wicket when you have a ui designer and developer on staff who can create an MVC UI from scratch?
Please, if this doesn't make sense I hope you feel compelled to ask questions to pull whatever info you need and I am not saying. I am desperately trying to figure a.) does wicket make sense still, b.)how in the heck do I build a UI using it!
I think it can't get better than the examples in wicketstuff. You can just parse through the forminput sample. The sourcecode button is on right top.
There is indeed a small curve related to getting started with wicket as it changes the complete direction of thinking towards web GUI.
Basically, the idea of wicket is to have HTML template pages with some wicket markup placeholders that will be filled by the parallel java class.
The best way is to start looking at wicket tutorials on the official Wicket website. Then there is wicketstuff, which also has a very comprehensive collection as mentioned by Suraj Chandran. Most examples show you both Java and the associated HTML markup.
Even if you are not a Java developer it would be beneficial for you to understand how different Wicket markup tags get interpreted and how a Wicket-based application is built from several HTML pages, borders, panels and other Wicket-related components.
Wicket is very good for separating Java code from HTML (much better than frameworks that use JSP, PHP, and other technologies that mix code with HTML). Because there is no Java source code in the HTML pages it makes it easier for designers to work independently of the developers. Also HTML files can be edited in HTML editor programs like Dreamweaver directly.
If you are a Dreamweaver user and are familiar with Template and Library functions, then in the Wicket world you will find very similar concepts. Dreamweaver Template = Wicket Border, Dreamweaver Library Item = Wicket Panel, for example.
Coming from PHP with some Java Struts 2.0 experience any tips/tricks on learning GWT? I have been looking at some tutorials but just wanted to know if anyone has some great gems to pass along?
As someone that has done PHP, Struts2 and GWT, a good tips from me for someone that is coming from web framework like Struts2.0/PHP would be:
Throw away the old mindset, the mindset that a web framework works in request-response way. That's not how GWT works. GWT is a full ajax framework. Get a good understanding of AJAX and throw away those old mindset to get a good grasps of GWT.
Think in application development and not website development. That would affect the way you build navigation in your application with GWT.
You are not building hyperlinks to navigate between html pages, but you are using an event listener to update a partial content in your application. Get a good understanding of this.
With that in mind, always remember that you are not throwing back full html pages, but just updating a partial content in your application
Get a good understanding of Java anonymous class and inner class because you will use this alot in GWT. This is something that is used rarely if you are building with Struts2.0
The last tips would be to learn how to organize your code. If you can do it from beginning, please do so. Because you can write everything in one class if you want to. A good tip would be to take a look at this video on best practice on GWT.
Nothing beats Google's GWT quickstart (IMO):
http://code.google.com/webtoolkit/gettingstarted.html
I agree with karim79. Also add this to your list: http://examples.roughian.com/
GWT developers still need good HTML and CSS skills. It is sometimes useful to build up chunks of HTML on the client or server side (performance, skinning etc.) and not build every part of your GUI using GWT Widget trees in Java code.
Our framework (GWT Portlets) will help you structure your application. It includes a simple demo application in its own directory that you can copy to start a project.
How do you take a java library that is for the desktop or an applet and make it so you can use its functions for a web page? I know not all things are meant for the web, but can you call a "regular" java class in an apache/tomcat setup server and it "work"? Do you have to so something to it to get it work with a web page?
I was interested in jgrapht for the web but it looks like all desktop or applet and I don't know that it would be possible to return its graphics to the browser, but maybe its libraries and a generated .png rendered by the browser.
Although there is debate on applets being alive or dead, I am not interested in using one at the moment, as it appears it is dead, albeit with new possible life in the latest update 6u10. I don't know that I want to invest in JavaFX either.
Johnny, the thing is that you have to decide what you mean to do. You could, for example, use JGraphT in server side code; the graph could be visualized in a bunch of different ways, like JGaph or graphviz. Then you would output the visualization in some form that works on the web and put it into your web page. In JGraph, that probably means a print interface that generates SVG or PNG.
Or you could emit the graph structure as JSON with a simple walk of the graph and interpret it on the fly in the browser using Javascript.
It's hard to answer the question generally, because it strongly depends on how you mean to use it.
Yes, it is possible to use a java class or jar file in a web appliaction, but it also depends on what you want to do with it.
For example if the library is for mathematics and you want to return results back to the users on a web based application, this is definitely possible. There are many other examples I can give but they are all the same.
As for displaying charts, I have successfully used JFreeChart in a web application using Apache Wicket (which rocks btw).
So to answer your question, you don't really need to "port" the library, you just need to use it and display it's output to a web page instead of a java desktop GUI.
Of course their might be some libraries that are specifically designed for Java GUI stuff like Swing or AWT. But for the most part there is no difference in using a Java library in a J2EE environment or a J2SE environment.
There isn't a closed-form answer to what you are suggesting: porting a Java Library to a browser's environment and using its functionality.
If you are interested in graphing things, here are a few things you can try:
Open Flash Chart - a scriptable flash app that will produce graphs
Bluff - a Javascript library that produces graphs
processing.js - a port of the excelling 'processing' library to Javascript
As for accessing Java-based functionality in the browser, there are some approaches for that. One is to use a toolset like GWT that complies java into an HTML/Javascript/Java application. Another is to use an AJAX-based technology like Direct Web Remoting. It really depends on what you are trying to accomplish.
I've looked breifly into GWT and like the idea that I can develop in Java and have the application compile down to HTML and JavaScript. Is the concept behind GWT and AWT and Swing the same or different?
It is programmed very similarly(patterned after Swing) and the code is 100% java (compiles with a standard Java compiler without errors), but the way it works is very different. Instead of compiling into a Java app, it compiles into Javascript that is sent to your browser.
This ability to program good active Javascript without actually coding Javascript and HTML is pretty nice.
Also, since it programs much like swing, you can do stuff like adding listeners that effect other controls pretty easily.
GWT is very much similar to Swing in its usage of Widgets, Panels and the EventListeners it provides. A different way to look at GWT is to think of Javascript and HTML as Assembly language and GWT as a sort of High level language which generates Javascript and HTML. With GWT its easy to develop desktop-like apps for the web using the same tools you would use for building a desktop app
Define concept.
AWT/Swing are used for desktop Java apps or applets. They both require JVM to run.
GWT is used to translate Java code to Javascript. This only runs on Javascript engines, i.e. browser.
The API design, as stated above, is similar to Swing. You get the same Panels, Buttons and other Component classes as in Swing.
AWT and Swing are for programming stand-alone applications (and to a lesser extent, applets). GWT is supposed to make programming web applications similar to stand-alone apps. I wouldn't program a non-web app using GWT.
GWT is conceptually similar to Swing, but is more a replacement for JSPs than anything else.
GWT is a javascript toolkit that allows you to write the javascript in Java. The only real similarities to Swing and AWT are that they are toolkits for creating user interfaces and they use Java. The end product is different and the real purpose for using them is different. GWT gives you the ability to generate a ajax user interface for a web browser while the other 2 give you a console (or applet) java app. In my mind the real reason for using GWT is to get a quick ajax interface up for prototyping purposes. But I dont think its really production ready- ie I dont thing Google uses it in their own webapps. A better choice for more robust ajax webapps is http://developer.yahoo.com/yui/ or http://script.aculo.us/.
disclamer: While I do work at IT Mill, this is just for information to the original poster. This isn't marketing spam.
If you like the idea of being able to write Java and get a webpage out of that, you might be interested in IT Mill Toolkit. It's a toolkit for making RIA software on top of a J2EE stack, and it uses GWT heavily.
One of the basic ideas are that the code generated by GWT is just as prone to client-side forging attacks as any other JS/Ajax-traffic. IT Mill Toolkit makes sure that the data is validated server-side too.
The toolkit is also designed in such a way that if you are familiar to Swing, you should have no problems picking it up.