All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.googlecode.gwt.charts.client.util.GadgetHelper Maven / Gradle / Ivy

/*
 * Copyright 2012 Rui Afonso
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */
package com.googlecode.gwt.charts.client.util;

import com.google.gwt.core.client.JavaScriptObject;

import com.googlecode.gwt.charts.client.query.Query;
import com.googlecode.gwt.charts.client.query.QueryResponse;

/**
 * A helper class to simplify writing Gadgets that use the Google Visualization API.
 * 
 * @see GadgetHelper API
 *      Reference
 */
public class GadgetHelper extends JavaScriptObject {
	/**
	 * Creates a new instance.
	 * 
	 * @return a new GadgetHelper instance
	 */
	public static final native GadgetHelper create() /*-{
		return new $wnd.google.visualization.GadgetHelper();
	}-*/;

	/**
	 * Create a new instance of google.visualization.Query and set its properties according to values from the gadget
	 * preferences. The type of parameter prefs is _IG_Prefs
	 * 
    *
  1. * Preference _table_query_url is used to set the Query data source URL.
  2. *
  3. Preference _table_query_refresh_interval is used to set the Query refresh interval (in seconds). *
* * @param prefs gadget API user preferences * @return a new instance of {@link Query} * @see Gadget API User * Preferences */ public static final native Query createQueryFromPrefs(JavaScriptObject prefs) /*-{ return $wnd.google.visualization.GadgetHelper.createQueryFromPrefs(prefs); }-*/; /** * Parameter response is of type google.visualization.QueryResponse. Returns true if the response contains data. * Returns false if the query execution failed and the response does not contain data. If an error occured, this * method displays an error message. * * @param queryResponse * @return true if the response contains data */ public static final native boolean validateResponse(QueryResponse queryResponse) /*-{ return $wnd.google.visualization.GadgetHelper.validateResponse(queryResponse); }-*/; protected GadgetHelper() { } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy