com.google.gwt.core.client.GWT.getModuleName()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(183)

本文整理了Java中com.google.gwt.core.client.GWT.getModuleName()方法的一些代码示例,展示了GWT.getModuleName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GWT.getModuleName()方法的具体详情如下:
包路径:com.google.gwt.core.client.GWT
类名称:GWT
方法名:getModuleName

GWT.getModuleName介绍

[英]Gets the name of the running module.
[中]获取正在运行的模块的名称。

代码示例

代码示例来源:origin: libgdx/libgdx

this.root = config.rootPanel;
} else {
  Element element = Document.get().getElementById("embed-" + GWT.getModuleName());
  if (element == null) {
    VerticalPanel panel = new VerticalPanel();

代码示例来源:origin: libgdx/libgdx

this.root = config.rootPanel;
} else {
  Element element = Document.get().getElementById("embed-" + GWT.getModuleName());
  if (element == null) {
    VerticalPanel panel = new VerticalPanel();

代码示例来源:origin: com.google.gwt/gwt-servlet

@Override
public SafeHtml processHtml(SafeHtml html) {
 // If the widget is listening for load events, we modify the HTML to add the
 // load/error listeners.
 if (loadEventsInitialized && html != null) {
  String moduleName = GWT.getModuleName();
  String listener = "__gwt_CellBasedWidgetImplLoadListeners[\""
    + moduleName + "\"]();";
  String htmlString = html.asString();
  htmlString = htmlString.replaceAll("(<img)([\\s/>])", "<img onload='"
    + listener + "' onerror='" + listener + "'$2");
  // We assert that the resulting string is safe
  html = SafeHtmlUtils.fromTrustedString(htmlString);
 }
 return html;
}

代码示例来源:origin: com.google.gwt/gwt-servlet

initLoadEvents(GWT.getModuleName());

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * This constructor may be used by subclasses to explicitly use an existing
 * element. This element must be a &lt;form&gt; element.
 *
 * <p>
 * If the createIFrame parameter is set to <code>true</code>, then the wrapped
 * form's target attribute will be set to a hidden iframe. If not, the form's
 * target will be left alone, and the FormSubmitComplete event will not be
 * fired.
 * </p>
 *
 * @param element the element to be used
 * @param createIFrame <code>true</code> to create an &lt;iframe&gt; element
 *          that will be targeted by this form
 */
protected FormPanel(Element element, boolean createIFrame) {
 super(element);
 FormElement.as(element);
 if (createIFrame) {
  assert ((getTarget() == null) || (getTarget().trim().length() == 0)) : "Cannot create target iframe if the form's target is already set.";
  // We use the module name as part of the unique ID to ensure that ids are
  // unique across modules.
  frameName = "FormPanel_" + GWT.getModuleName() + "_" + (++formId);
  setTarget(frameName);
  sinkEvents(Event.ONLOAD);
 }
}

代码示例来源:origin: fr.putnami.pwt/pwt

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);
  }
}

代码示例来源:origin: sk.seges.acris/acris-security-core

public static String getModuleBaseUrl() {
  String baseUrl = GWT.getModuleBaseURL();
  int indexOf = baseUrl.indexOf(GWT.getModuleName());
  if (indexOf > -1) {
    baseUrl = baseUrl.substring(0, indexOf);
  }
  return baseUrl;
}

代码示例来源:origin: org.jbpm/jbpm-wb-integration-client

private String getWebContext() {
  String context = GWT.getModuleBaseURL().replace(GWT.getModuleName() + "/",
                          "");
  if (context.endsWith("/")) {
    context = context.substring(0,
                  context.length() - 1);
  }
  return context;
}

代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils

private InputStream getWebXmlAsStream() {
  for (String warRoot : WAR_ROOTS) {
    try {
      return new FileInputStream(warRoot + WEB_XML);
    } catch (FileNotFoundException e) {
      // try next
    }
  }
  throw new GwtTestConfigurationException("Cannot find 'web.xml' file ' for GWT module "
      + GWT.getModuleName());
}

代码示例来源:origin: kiegroup/appformer

private String getWebContext() {
  String context = GWT.getModuleBaseURL().replace(GWT.getModuleName() + "/",
                          "");
  if (context.endsWith("/")) {
    context = context.substring(0,
                  context.length() - 1);
  }
  return context;
}

代码示例来源:origin: kiegroup/jbpm-wb

private String getWebContext() {
  String context = GWT.getModuleBaseURL().replace(GWT.getModuleName() + "/",
                          "");
  if (context.endsWith("/")) {
    context = context.substring(0,
                  context.length() - 1);
  }
  return context;
}

代码示例来源:origin: de.knightsoft-net/gwt-bean-validators-spring-gwtp

@Provides
 @RestApplicationPath
 String getApplicationPath() {
  return StringUtils.removeEnd(StringUtils
    .removeEnd(StringUtils.removeEnd(GWT.getModuleBaseURL(), "/"), GWT.getModuleName()), "/");
 }
}

代码示例来源:origin: com.isotrol.impe3/impe3-gui-common

/**
 * @return the application context url
 */
public static String getBaseApplicationContext() {
  if (appContextBaseUrl == null) {
    int sizeModuleName = GWT.getModuleName().length();
    int sizeModuleBaseUrl = GWT.getModuleBaseURL().length();
    int sizeContext = sizeModuleBaseUrl - sizeModuleName;
    appContextBaseUrl = GWT.getModuleBaseURL().substring(0, sizeContext - 1);
  }
  return appContextBaseUrl;
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-api

@JsOverlay
  public static final BPMNDocumentation create(ProcessOverview process, ElementDetails elementsDetails,
                         String diagramImage) {
    final BPMNDocumentation instance = new BPMNDocumentation();
    instance.process = process;
    instance.elementsDetails = elementsDetails;
    instance.diagramImage = diagramImage;
    instance.moduleName = GWT.getModuleName();
    return instance;
  }
}

代码示例来源:origin: gwt-test-utils/gwt-test-utils

Object getRpcServiceFromInjector(Injector injector, Class<?> remoteServiceClass,
                 String remoteServiceRelativePath) {
  if (servletDefinitionReader == null) {
    servletDefinitionReader = new ServletDefinitionReader(injector);
  }
  // Try from Guice injection.
  String moduleName = GWT.getModuleName();
  return servletDefinitionReader.getServletForPath("/" + moduleName + "/" + remoteServiceRelativePath);
}

代码示例来源:origin: org.codehaus.sonar/sonar-gwt-api

protected final RootPanel getRootPanel() {
 RootPanel result = RootPanel.get("gwtpage-" + GWT.getModuleName());
 if (result == null) {
  result = RootPanel.get("gwtpage");
 }
 return result;
}

代码示例来源:origin: jbossas/console

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;
}

代码示例来源:origin: org.uberfire/uberfire-runtime-plugins-client

@Override
  public void execute() {
    form.setAction(GWT.getHostPageBaseURL().replaceAll("/" + GWT.getModuleName(),
                              "") + pluginConfigService.getMediaServletURI() + pluginName);
    form.submit();
  }
},

代码示例来源:origin: org.codehaus.sonar/sonar-gwt-api

public final void onModuleLoad() {
 export(GWT.getModuleName(), this);
 load();
 onResourceLoad();
}

代码示例来源:origin: net.wetheinter/xapi-gwt-io

protected Dictionary<String, String> normalizeHeaders(StringDictionary<String> headers) {
 if (headers == null) {
  headers = X_Collect.newDictionary();
 }
 if (!headers.hasKey("X-Gwt-Version")) {
  headers.setValue("X-Gwt-Version", GWT.getPermutationStrongName());
 }
 if (!headers.hasKey("X-Gwt-Module")) {
  headers.setValue("X-Gwt-Module", GWT.getModuleName());
 }
 return headers;
}

相关文章