On Thu, Mar 12, 2009 at 5:40 PM, Rosh PR <[email protected]> wrote:
> One of the problems I'm facing over here is how will i compile a
> small set of gwt code with out any EntryPoint and use the
> generated *javascript* from the framework. I know we can compile
> without the Entrypoint but the main problem I'm facing is compiling
> code to javascript instead of java classes and loading it to the
> framework which will have to use these JS and display the plugin
> widget on the framework console on runtime.
>
Interesting problem.
This is going to need some kind of infraestructure and policy. I am just
thinking out loud waiting more experienced people point problems and what
can work. To start you need two things:
a) Know what plugins exists, a registry of plugins
b) Attach them into a panel, listen events and useful stuff
To install the plugins you can drop them in folder. To know what exists you
can do it manually, setting up a file and fetching it from the client side.
To do it automatically you can do it server side and rpc-serialize'it to
client side.
To load them the main problem is obfuscated code. I imagine you can't mix up
source comming from different optimizer executions. Let's suposse we can.
Then if we know the plugin main object name, we can construct a jsni method
to forge a call to the pluing initializer function, with the panel id to be
attached.
native void initPlugin(String objectName, String panelId) /*-{
var method = "@"+objectName+"::doInit(Ljava/lang/String;)";
eval( method+"('"+panelId+"');" );
}-*/;
That should give to the plugin the ability to put itself into the panel and
call whatever container hooks needs.
Another way is doing plugin static iniatilazation self injection:
class CoolPlugin extends Plugin {
static {
Application.staticSomething.register(new CoolPlugin());
}
So the application can take further actions...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---