this.root = config.rootPanel; } else { Element element = Document.get().getElementById("embed-" + GWT.getModuleName()); if (element == null) { VerticalPanel panel = new VerticalPanel();
this.root = config.rootPanel; } else { Element element = Document.get().getElementById("embed-" + GWT.getModuleName()); if (element == null) { VerticalPanel panel = new VerticalPanel();
@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; }
initLoadEvents(GWT.getModuleName());
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be a <form> 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 <iframe> 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); } }
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); } }
public static String getModuleBaseUrl() { String baseUrl = GWT.getModuleBaseURL(); int indexOf = baseUrl.indexOf(GWT.getModuleName()); if (indexOf > -1) { baseUrl = baseUrl.substring(0, indexOf); } return baseUrl; }
private String getWebContext() { String context = GWT.getModuleBaseURL().replace(GWT.getModuleName() + "/", ""); if (context.endsWith("/")) { context = context.substring(0, context.length() - 1); } return context; }
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()); }
private String getWebContext() { String context = GWT.getModuleBaseURL().replace(GWT.getModuleName() + "/", ""); if (context.endsWith("/")) { context = context.substring(0, context.length() - 1); } return context; }
private String getWebContext() { String context = GWT.getModuleBaseURL().replace(GWT.getModuleName() + "/", ""); if (context.endsWith("/")) { context = context.substring(0, context.length() - 1); } return context; }
@Provides @RestApplicationPath String getApplicationPath() { return StringUtils.removeEnd(StringUtils .removeEnd(StringUtils.removeEnd(GWT.getModuleBaseURL(), "/"), GWT.getModuleName()), "/"); } }
/** * @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; }
@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; } }
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); }
protected final RootPanel getRootPanel() { RootPanel result = RootPanel.get("gwtpage-" + GWT.getModuleName()); if (result == null) { result = RootPanel.get("gwtpage"); } return result; }
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; }
@Override public void execute() { form.setAction(GWT.getHostPageBaseURL().replaceAll("/" + GWT.getModuleName(), "") + pluginConfigService.getMediaServletURI() + pluginName); form.submit(); } },
public final void onModuleLoad() { export(GWT.getModuleName(), this); load(); onResourceLoad(); }
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; }