Java Code Examples for com.google.gwt.core.client.GWT#getModuleName()

The following examples show how to use com.google.gwt.core.client.GWT#getModuleName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LeafletResources.java    From gwty-leaflet with Apache License 2.0 6 votes vote down vote up
public static void whenReady(boolean debug, Element.OnloadFn function){
	HTMLScriptElement leafletScript = (HTMLScriptElement) DomGlobal.document.createElement("script");
	if (debug) {
		leafletScript.src = GWT.getModuleName() + "/leaflet/leaflet-src.js";
	} else {
		leafletScript.src = GWT.getModuleName() + "/leaflet/leaflet.js";
	}
	leafletScript.type="text/javascript";
	
	HTMLLinkElement leafletStyle = (HTMLLinkElement) DomGlobal.document.createElement("link");
	leafletStyle.href=GWT.getModuleName()+"/leaflet/leaflet.css";
	leafletStyle.rel="stylesheet";
	
	
	DomGlobal.document.head.appendChild(leafletScript);
	DomGlobal.document.head.appendChild(leafletStyle);
	
	leafletScript.onload = function;
}
 
Example 2
Source File: Util.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
private static void redirectToRoot(String moduleName, String parameters) {
	String base = GWT.getHostPageBaseURL();
	String module = GWT.getModuleName();
	if (moduleName != null)
		module = moduleName;
	String url = base + (base.endsWith("/") ? module + ".jsp" : "/" + module + ".jsp");
	url += "?locale=" + I18N.getLocale() + "&tenant=" + Session.get().getTenantName();
	if (parameters != null)
		url += "&" + parameters;
	Util.redirect(url);
}
 
Example 3
Source File: GwtStatisticsEventDispatcher.java    From swellrt with Apache License 2.0 5 votes vote down vote up
public StatisticsEvent newEvent(String system, String group, double millis, String type) {
  Event event = new Event(GWT.getModuleName(), system, group, millis);
  if (type != null) {
    setExtraParameter(event, "type", type);
  }
  return event;
}
 
Example 4
Source File: Image.java    From putnami-web-toolkit with GNU Lesser General Public License v3.0 5 votes vote down vote up
public void setSrc(String src) {
	this.src = src;
	if (this.src != null) {
		if (this.src.startsWith("/")) {
			this.src = GWT.getModuleName() + this.src;
		}
		this.imgElement.setSrc(this.src);
	}
}
 
Example 5
Source File: GwtStatisticsEventDispatcher.java    From incubator-retired-wave with Apache License 2.0 5 votes vote down vote up
public StatisticsEvent newEvent(String system, String group, double millis, String type) {
  Event event = new Event(GWT.getModuleName(), system, group, millis);
  if (type != null) {
    setExtraParameter(event, "type", type);
  }
  return event;
}
 
Example 6
Source File: GwtStatisticsEventDispatcher.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public StatisticsEvent newEvent(String system, String group, double millis, String type) {
  Event event = new Event(GWT.getModuleName(), system, group, millis);
  if (type != null) {
    setExtraParameter(event, "type", type);
  }
  return event;
}