Server-side GWT events; alternative to Vaadin - gwt

I'm wondering is there a similar framework like Vaadin built on top of GWT which wraps the original GWT components but with server-side only event handling? (I know that Vaadin is built on top of GWT. I'm looking for an alternative solution.)
Vaadin is nice because of it's precompiled nature. I found compile times with GWT horrific the last time i've worked with it. Also it's a bit easier to maintain security if event handling code runs on the server. It would be nice if the standard GWT could be used in a similar way.

I don't think there is another like vaadin. and vaadin is already server-side..
see this http://vaadin.com/learn for more info

Have you seen this? - http://code.google.com/p/gwteventservice/

For server-side alternative, you might take at a look at ZK too.
Notice that its client side is based on jQuery, not GWT. However, you won't notice it at all since they both are server-side solutions and using pure Java.

Event handlers that you normally deal with are in server-side Java code. Consider this:
final Button testButton = new Button("Test Button");
testButton.addListener(new Button.ClickListener()
{
#Override
public void buttonClick(ClickEvent event)
{
mainWindow.showNotification("I am server-side code!");
}
});
As you said, you need to compile GWT code only when adding a custom component to your code. Vaadin's built in components are already compiled and put in the jar file. Although sometimes your IDE might detect your project as a GWT project and try to compile the widgetsets every time you change the code, when you might want to ask it to ignore.
If you look for alternatives to Vaadin you might have a look at Echo2.

Related

Exporting a class and its methods in GWT for use in native JavaScript

I'm developing a GWT project at the moment and it's been up and running for a while. New functionality that is to be added require extensive testing, visualizing and simulating of a specific algorithm. I would like to export that specific algorithm so that I may call it directly from JavaScript and do some canvas magic.
How can I export a number of classes for direct use in JavaScript from a GWT project?
I've tried using the GWT exporter, following the Getting Started section closely.
I've noticed that my output directory contains a new generator class (TestClassExporterImpl.java) but the final JavaScript output contains no trace of my TestClass or the exported methods.
I'm sure I've made a mistake somewhere on the way or didn't understand the GWT exporter correctly.
Try to disable obfuscation, it will create the same names in Javascript as in the original Java code

Migrating to E4 - equivalent of PlatformUI.isWorkbenchRunning

In our Eclipse RCP 3.7 application we have quite a few calls to PlatformUI.isWorkbenchRunning().
For example most of the calls are guards around Workbench API calls, along the lines of
`
if (PlatformUI.isWorkbenchRunning()) {
display = PlatformUI.getWorkbench().getDisplay();
} else {
display = Display.getDefault();
}
We're migrating now to Eclipse RCP 4.4 and I can't find the correct way to replace these calls with RCP 4 compliant code.
I'm guessing I should inject some service / component and use that, but which component? IWorkbench cannot tell me whether it's running or not.
I would expect it to be quite a common problem, but could not find a solution by googling. Anyone solved this already?
e4 does not currently run headless so there isn't really an equivalent.
For access to the Display you can use
Display.getDefault()
everywhere.
If you have a class derived from SWT Control available you can also use Control.getDisplay()
If you want to use the asyncExec or syncExec methods of Display you can use UISynchronize as an alternative:
#Inject
UISynchronize uiSynch;
uiSynch.asyncExec(runnable);

using phonegap with gwt in IntelliJ

I want to migrate all my project to one source code using GWT.
The wen is using GWT and using RPC to GAE.
I'm looking for a phonegap-gwt-intelliJ sample project. Something that I can start with.
Thanks
yo
http://funfreelance.com/android-using-intellij-ide-with-phonegap/
enjoy :)
Well, i've done today an Hello World APP with Eclipse/PhoneGap and, as i use to code with PhpStorm ,i found Eclipse not so well and complicated to implement simple things ....(not as fast , complicated way to add simple javascript Autocompletion, you have to add HTML view , PHP view and so one) .... witch IDE are you using (for the people that read this post ) .....

What is the use GWT generator?

I have seen that GWT framework is having generator feature.
In what case we have to use gwt generator option and why it is needed?
Can anyone tell me simply why,what is gwt generator? Done some googling. But not much helpful stuffs...
From this tutorial:
Generators allow the GWT coder to generate Java code at compile time and have it then be compiled along with the rest of the project into JavaScript.
This tutorial uses the example of generating a Map of values at compile time based on a properties file.
I've done GWT development for 3 years now and I've written one generator :) I've written a couple of linkers for experimental purposes so I think they are more common, though still rare. The classic case is where you want to write
X x = GWT.create(X.class)
and have the particular subclass or implementation of X constructed at compile time based on, perhaps, annotations in the provided X class or interface. GWT uses them for things like the CSSResource.
Search for "GWT Generator Experiments" site:development.lombardi.com on google for some info about what I did.
One of the use cases is to mimic reflection on the client side by building a factory class on the fly. I remember answering a question posted by you earlier on how to do this
How to create new instance from class name in gwt?
So i guess you already know the application. What else are you looking for? Can you be precise?
I've started using GWT Generators where I needed Java Reflection. I've documented One of the use cases for using GWT generators here:
http://jpereira.eu/2011/01/30/wheres-my-java-reflection/
Hope it helps.
If you refer to code generator, yes, there will a tool supporting GWT 2.1 code generation. For more details and a quick start, see http://www.springsource.org/roo/start
A general roo intro is here http://blog.springsource.com/2009/05/01/roo-part-1/
Another visual tutorial is at http://www.thescreencast.com/2010/05/how-to-gwt-roo.html
Check out this implementation:
http://samuelschmid.blogspot.com/2012/05/using-generator-for-generic-class.html
You can create new Instances of classes on client with foo.newInstance("fully.qualified.class.name");

GWT Composite best practices

I'm learning GWT and have started to get the hang of it. I'm at the point where my code is getting to be a spaghetti mess so I'm going back and factoring reasonable bits of it out as Composites. The first problem I ran into was that my tool support failed to give the new Composite class an initWidget() method. It did include a default constructor.
For the time being, I've simply filled in my overridden initWidget() method with a call to super(initWidget(w)) My project compiles and runs as expected, though I feel as though I must be missing something.
What should I keep in mind when overriding init and what if anything do i need to place in the constructor. Is there anything else that I need to know or does it just boil down to regular old Java after this?
Clarification - It has occurred to me that there are probably different answers to this question depending on whether you intend to release said Composite classes as part of a library or simply part of your stand-alone app. I in particular have no intention at this time of developing externally useful components (mainly because I'm so green in this particular technology.)
Thanks!
I'm not sure if I understand what you are trying to do. But for all the Composite's I've written I've never overridden the initWidget method. Because Composite itself doesn't need to be initialized with a constructor, i.e. no need to call super() my constructors of widgets extending composite look something like:
public mywidget() {
SomePanel p = new SomePanel();
....
initWidget(p);
}
As a best practice, imo, only the widget extending Composite should call it's 'own' initWidget.
"GWT Conference: Best Practices for Building Libraries" gives a couple of tips. You should also look at the source of GWT and at the source of one of the libraries for GWT (like gwt-ext)
[EDIT] I just saw another option: suco. From the description:
A micro library that helps to maintain your GWT client code clean and modular.