Well, one thing you can do is have the EntryPoint, and just tell plugin
developers that they have to attach to some particular div element in a
particular way, as opposed to the traditional root (i.e.
RootPanel.get("plugin-name-div")).

Then the user can request certain plugins to be added in which your GWT code
should create the div's for those plugins and load their scripts.

Hope this helps you get started.  Also, I would recommend staying away from
JSNI if you're not doing something that is absolutely not supported within
the GWT framework.

Just as an extension to the Java approach below, I would prefer something
like:

public abstract class PluginEntry implements EntryPoint
{
     String name;

     publc PluginEntry(String pluginName)
     {
           name = pluginName;
     }

    public final void onModuleEntry()
    {
    }

    protected abstract void onModuleEntry(
}

On Thu, Mar 12, 2009 at 2:13 PM, Matías Costa <m.costac...@gmail.com> wrote:

> On Thu, Mar 12, 2009 at 5:40 PM, Rosh PR <open....@gmail.com> 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 Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to