Hi Daniel,

Its coming back to me now:  a few months ago Miguel and I were tossing
around ideas about wrapping the AJAX loader.  Miguel was a proponent
of creating a separate API that only did AJAX loading that could be
shared by Maps,  Search, Visualization, or any other loader.

I think what you have will work.  Could you just write it into a
static utility class at the top level of the class path, say named:

com.google.gwt.visualization.client.AjaxLoader


On Thu, Nov 27, 2008 at 8:58 AM, Daniel Libicki <[EMAIL PROTECTED]> wrote:
>
>   public void onModuleLoad() {
>     Visualization.loadAPI(new Runnable(){
>       public void run() {
>         final VerticalPanel vp  = new VerticalPanel();
>         vp.getElement().getStyle().setPropertyPx("margin", 15);
>         vp.setWidth("100%");
>         vp.setHeight(Window.getClientHeight() + "px");
>         RootPanel.get().add(vp);
>         vp.add(new Label("Google Visualization with GWT demo."));
>         vp.add(tabPanel);
>         tabPanel.setWidth("800");
>         tabPanel.setHeight("600");
>         tabPanel.add(createPieChart(), "Pie Chart");
>         tabPanel.add(createTable(), "Table");
>         tabPanel.add(createDataView(), "DataView");
>         tabPanel.selectTab(0);
>       }}, PieChart.PACKAGE, Table.PACKAGE);
>   }
>
>   public static native void loadAPI(Runnable onLoad, JsArrayString packages)
> /*-{
>       var callback = function() {
>
> @com.google.gwt.visualization.client.ExceptionHelper::runProtected(Ljava/lang/Runnable;)(onLoad);
>     };
>       google.load('visualization', '1',
>           {'packages' : packages, 'callback' : callback});
>   }-*/;
>
>   public static void loadAPI(Runnable onLoad, String... packages) {
>     loadAPI(onLoad, AbstractDrawOptions.createJsArray(packages));
>   }
>
> let me know what you think.
>
> Daniel
>



-- 
Eric Z. Ayers - GWT Team - Atlanta, GA USA
http://code.google.com/webtoolkit/

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to