GWT Designer produced code - gwt

I'm trying to understand GWT and its associated Designer plugin better. Using one of the more recent versions of GWT Designer and GWT 2.* in your application, can you give me a sense for
1) how much additional (UI) code you needed to develop by hand (outside GWT Designer), perhaps as a rough percentage? Was this code generally doing the model interface and controller part of MVC?
2) how well were you able to go between "design and code view" -- i.e. keep using GWT Designer for your GUI layout after you supplemented with hand-written code?

1) It does a lot like it generates html code, and ui:fields and binds the ui:field with a variable in java class. You have to write to your handlers. It does the model interface and controller done by hands.
2) To me it took a lot of time to switch views, to me the designer's performance was poor and I try to finish nt work inside the designer before switching to code view.

Related

Outsource the generated Swing code

Is there any way to outsource the generated Java source code from the actual class (the frame or panel class) into an XML file (for example)?
I do not like this messy Swing code in my GUI objects; it makes my class huge and unreadable.
I know that the GUI Builder which is implemented into the IntelliJ IDEA can do that (see http://www.jetbrains.com/idea/features/gui_builder.html).
GUI Builder (from Google, formerly Instantiations) always generate Java code. That is actually the primary idea of the designer :-)
There are many things you can do using Java as the implementation language that cannot be done with XML or other static specification languages.
EDIT: You can also look at XWT - XML Windowing Toolkit - though I don't whether it works under Eclipse 3 or "just" Eclipse 4...

A layout implementation such as Eclipse

I have been working on a project model and pretty much completed it. Now I must implement the view of the project. I like eclipse view layout very much and tried to implement like this but I couln't. And then download source code of eclipse but couldn't find my specific code snippet in all of the source code. I mean I want to take basic layout implementation like eclipse Coolbar,ctabfolder and events. any suggections ?
Thanks.
If you like the Eclipse look and feel and the components used, you should have a look into the technologies used with Eclipse:
SWT is the GUI toolkit. It differs from Swing in that it uses the native widgets, if possible. This makes an application using it behave more like a native application than Swing does, which has its own set of components. You will find the raw components that you mention here.
JFace is an application framework based on SWT. It provides higher level conceptual components.
Eclipse RCP is a platform for building application. It takes away some common tasks of application building but, of course, you need to learn the concepts first.
Swing has similar components, but does not use the native widgets. It draws them itself. In my opinion Swing is easier to learn and to use but the results of SWT are often nicer - you can often "feel" that a Swing application behaves not completely right. It is better if Swing applications do not try to mimic the native look and feel to avoid the uncanny valley effect. So expect your resulting application to look and feel different.
There are more documentation and third-party libraries available for Swing, for example the very nice Netbeans RCP that let's you easily build applications.
What you are looking for is a docking framework. What the best framework is is open for debate.
You might have a look at this question for a list of popular frameworks

GWT Special Features compared to other Frameworks

I am on searching special features of GWT which are present only in GWT and not in other web framework. I am a student and I am not well acquainted to the many web frameworks on the market, so if u can help me increasing my list of special GWT features, it would be a great help. Some which i know are:
1. GWT allows using java to program
web. (only, it also allows merging
javascript through JSNI of course)
2. The developer does not have to be a guru in browser incompatibilities
to develop web sites which works on
a variety of browsers because
incompatibilities are handled by GWT
through differed bindind
3. GWT allows easy integration of popular Java Tools such as ,
hibernate through gilead
4. GWT enables server implementation not only in java but also other
languages such as php
5. GWT enables code splitting which improves application interactivity
by allowing javaScript file to
download only when required
6. In essence GWT is toolkit, it does not force a way to program,
other layers can be placed on top of
it to program such as placing MVP or
MVC framework on top of GWT and then
develop app
7. GWT MVP is great because first it allows collaborative working, faster
testing with JUnit and the event bus
allows many updates in client side
application by placing event on the
event bus
8. GWT compiled java files to obfuscated mode which is first small
and make the application safer
because bots fails on the javascript
generated during the obfuscated mode
In case in the 8 points, i've mention something which not special to GWT, then let me know.
There's also 'perfect caching', which is the term used to describe the way that GWT optimises JavaScript for each browser.
Instead of building a large JavaScript file, with code that can handle all of the various browsers, GWT builds multiple JavaScript files at compile time, and downloads only the one that is relevant to the browser type that is being used.
EDIT: Every time you make a change to your Java code, GWT changes the name of the corresponding JavaScript file. Web servers can turn on caching for the JavaScript files (so that browsers won't re-download the same file), assured that the name will change when the Java code changes, and the browser will then download the latest version.
EDIT: I also really like the CssResource feature. By creating obfuscated CSS style names, GWT effectively gives each widget its own namespace for CSS styles; for example, I could define a 'pretty' style name on two different widgets, and have those styles using different CSS rules. Of course, it is possible to share CSS styles between widgets too.
Image resources are cool too. They optimise the way that images are downloaded and accessed.
Don't forget internationalization.
I think you pulled together a pretty decent list of differentiators there already. I think that one point worth adding is the RequestFactory feature in the most recent release, which, if you will, is simplistically speaking and RPC for data and makes it quite easy to develop Create, Read, Update and Delete - type (CRUD) of applications.
There are other, more important/wider accepted GUI-Frameworks that are based on Java.
There are for example Struts and JSF. That's why some of your points don't fit only for GWT, but for all GUI java frameworks in general, e.g. bullet point 1, 2 & 3.
But to add another one:
I think GWT is an easy way to code an AJAX-application, because it hides the AJAX stuff quite well. Wouldn't you agree?
Furthermore, GWT is a proprietary framework (which is somehow a unique property). JSF is standardized and Struts is lead by Apache.

drag and drop environment to start developing in gwt

is there any drag and drop environment to work with GWT widgets.
or any user friendly IDE or plugin on IDE's
i remember using some thing like MyEclips for developing Hibernate was better then working with .xml files.
The Eclipse-based WindowBuilder Pro supports GWT and is now free, courtesy of Google.
I tried GWT Designer, http://code.google.com/webtoolkit/tools/gwtdesigner/index.html, but I think for now I'll stick to code the guis myself by hand.
The main reasons are:
Sometimes, it takes a little while (longer than I can wait) to load the design mode.
Sometimes it breaks after you modify code underneath.
Sometimes, does not do what you expect it to do.
I would suggest you giving it a try and see if it works out for your needs.
In my opinion, the experience using it has been frustrating than encouraging.

GWT: UiBinder or GWT Designer?

I have my first GWT project that I created using UiBinder (GWT 2.0 way) which I found to be easier than write my UI creation Java source code (GWT 1.0 way).
But I saw this thing called GWT Designer that Google are releasing for free. It has nice features and wizards which were missing with the standard Google Eclipse Plugin. I like it, but I still think that using UiBinder is better. I think GWT Designer will be really useful when it can help you write UiBinder XML files (GWT 2.0 way), and not just source code (GWT 1.0 way).
What do you think about it?
Do I need to migrate to GWT Designer project?
Will it be better if I migrate but still keep UiBinder UI creation?
The latest GWT Designer now has support for UiBinder, and it works great.
http://download.instantiations.com/D2GWTDoc/continuous/latest/docs/html/wizards/gwt/uibinder_composite.html
UiBinder can give you better performance and a better optimized download than traditional widget construction; to me that's enough of a reason to stick with UiBinder. If your app is light and fast enough as it is then the choice probably comes down to what style of development suits you best.
I wouldn't go as far as to port your existing UiBinder templates into the designer. Google will be adding support for them to GWT designer soon enough.
I haven't used the newly-freed GWT Designer yet myself, but I wouldn't expect that it would warrant migrating your entire project over to it if it's already written using UIBinder.
Remember that the two methods of constructing a UI are not mutually exclusive -- you can use the GWT Designer to create a new widget and use it in an existing UIBinder project, and if you decide it's that much better, you can consider migrating at that point. Or not, since they can still happily coexist.
If you are doing professional development in an organization that utilizes experts in CSS and html, then GWt is going to be a tough sell if you don't use something like UIBinder for layouting as well as individual pages. I also think that a CSS designer can do a better job at responding to UI requirement changes than a java developer using GWT layouting techniques.
However if your java staff has control of the requirements and don't have to answer to UI designers, then I suppose choosing between delcarative templates and something like GWT Designer is just a matter preference.
As said in the relaunch announcement:
Now that these products are available again, we hope you’ll start using them within your GWT projects. Meanwhile, our next step is to more deeply unify them into the GWT family of tools by blending the fantastic Instantiations technology into the Google Plugin for Eclipse (GPE). So, there’s much more to come, including things we’re pretty sure you’ll like, such as UiBinder support in GWT Designer.
It wouldn't make sense to get ride of your UiBinder code since GWT Designer will support it soon.
DON'T use the designer plugin. The most recent update (8.1.1 at the time of this post) contains buttons that allow the user to add elements that are incompatible with IE, for instance CellTable, DeckPanel, HorizontalPanel and VerticalPanel.
This means whoever uses the plugin, uses it entirely at their peril. If IE7 tries to pull in these elements, it will load a partial page but fail to load components that use these elements. IE8 may not be able to load the application at all.