public static String getGeodeskId() { String geodeskId = Window.Location.getHref(); if (!geodeskId.contains(GdmLayout.geodeskPrefix)) { return null; } geodeskId = geodeskId.substring(geodeskId.indexOf(GdmLayout.geodeskPrefix) + GdmLayout.geodeskPrefix.length()); geodeskId = geodeskId.substring(0, geodeskId.indexOf('/')); return geodeskId; }
/** * The URL that will be used to open up assets in a feed. * (by tacking asset id on the end, of course !). */ public static String getSelfURL() { String selfURL = Window.Location.getHref(); if (selfURL.contains("#")) { selfURL = selfURL.substring(0, selfURL.indexOf("#")); } return selfURL; }
/** * The URL that will be used to open up assets in a feed. * (by tacking asset id on the end, of course !). */ public static String getSelfURL() { String selfURL = Window.Location.getHref(); if (selfURL.contains("#")) { selfURL = selfURL.substring(0, selfURL.indexOf("#")); } return selfURL; }
public static void getSession(final AsyncCallback<RecordingSessionDetailParams> callback) { final RecordingSessionDetailParamsJSO sessionDetail = new RecordingSessionDetailParamsJSO(); sessionDetail.setLanguage(getLanguage()); sessionDetail.setAntialiasingFonts(isFontsAntialiased()); sessionDetail.setBrowserHeight(getScreenHeight()); sessionDetail.setBrowserWidth(getScreenWidth()); sessionDetail.setBrowserName(getBrowserName()); sessionDetail.setBrowserVersion(getBrowserVersion()); sessionDetail.setColorDepth(getColorDepth()); sessionDetail.setHostName(Window.Location.getHostName()); sessionDetail.setInitialUrl(Window.Location.getHref()); sessionDetail.setJavaEnabled(Window.Navigator.isJavaEnabled()); sessionDetail.setOsName(getOsName()); sessionDetail.setReferrer(Document.get().getReferrer()); sessionDetail.setUserAgent(Window.Navigator.getUserAgent()); getIpInfo(new AsyncCallback<IpInfoJSO>() { @Override public void onFailure(Throwable caught) { callback.onFailure(caught); } @Override public void onSuccess(IpInfoJSO result) { sessionDetail.setIpAddress(result.getIp()); sessionDetail.setCity(result.getCity()); sessionDetail.setCountry(result.getRegion()); sessionDetail.setState(result.getCountry()); callback.onSuccess(sessionDetail); } }); }
/** * Checks if this child holds the current active state. * If the child is or contains the active state it is applied. */ protected void checkActiveState(Widget child) { // Check if this widget has a valid href String href = child.getElement().getAttribute("href"); String url = Window.Location.getHref(); int pos = url.indexOf("#"); String location = pos >= 0 ? url.substring(pos, url.length()) : ""; if (!href.isEmpty() && location.startsWith(href)) { ListItem li = findListItemParent(child); if (li != null) { makeActive(li); } } else if (child instanceof HasWidgets) { // Recursive check for (Widget w : (HasWidgets) child) { checkActiveState(w); } } }
/** * Checks if this child holds the current active state. * If the child is or contains the active state it is applied. */ protected void checkActiveState(Widget child) { // Check if this widget has a valid href String href = child.getElement().getAttribute("href"); String url = Window.Location.getHref(); int pos = url.indexOf("#"); String location = pos >= 0 ? url.substring(pos, url.length()) : ""; if (!href.isEmpty() && location.startsWith(href)) { ListItem li = findListItemParent(child); if (li != null) { makeActive(li); } } else if (child instanceof HasWidgets) { // Recursive check for (Widget w : (HasWidgets) child) { checkActiveState(w); } } }
protected void setLocaleFromCookies() { String language = Cookies.getCookie(LoginConstants.LANGUAGE_COOKIE_NAME); String localeName = LocaleInfo.getCurrentLocale().getLocaleName(); if (language != null && !language.isEmpty() && localeName != null && !localeName.isEmpty() && !language.equals(localeName)) { String url = URLUtils.transformURLToRequiredLocale(Location.getHref(), Location.getHostName(), null, localeName, language); if (!Location.getHref().equals(url)) { unbind(); RootPanel.get().clear(); Location.assign(url); } } }
private String getReturnURL() { return Window.Location.getHref(); }
@Override public String getHref() { return Window.Location.getHref(); }
private void prepareCommonAttributes(Throwable throwable, IncidentReport report) { report.setTimestamp(TimeUtils.current()); report.setMessage(JsonUtils.escapeValue(throwable.getMessage())); report.setStrongName(JsonUtils.escapeValue(GWT.getPermutationStrongName())); report.setUrl(Window.Location.getHref()); int length = throwable.getStackTrace().length; String[] stackTrace = new String[length]; StackTraceElement[] stackTrace1 = throwable.getStackTrace(); for (int i = 0, stackTrace1Length = stackTrace1.length; i < stackTrace1Length; i++) { StackTraceElement element = stackTrace1[i]; stackTrace[i] = JsonUtils.escapeValue(element.getMethodName()); } report.setStackTrace(stackTrace); }
@Override public void onValueChange(ValueChangeEvent<String> event) { eventBus.fireEvent(new PopStateEvent(event.getValue(), Window.getTitle(), Window.Location.getHref())); }
/** * The URL that will be used to open up assets in a feed. * (by tacking asset id on the end, of course !). */ public static String getSelfURL() { String selfURL = Window.Location.getHref(); if (selfURL.contains("#")) { selfURL = selfURL.substring(0, selfURL.indexOf("#")); } return selfURL; } }
@Override public void onValueChange(ValueChangeEvent<String> event) { eventBus.fireEvent(new PopStateEvent(event.getValue(), Window.getTitle(), Window.Location.getHref())); }
/** * Override to change the headers sent in the HTTP request. * * @param builder a {@link RequestBuilder} instance */ protected void configureRequestBuilder(RequestBuilder builder) { builder.setHeader("Content-Type", RequestFactory.JSON_CONTENT_TYPE_UTF8); builder.setHeader("pageurl", Location.getHref()); builder.setHeader(STRONG_NAME_HEADER, GWT.getPermutationStrongName()); }
/** * Override to change the headers sent in the HTTP request. * * @param builder a {@link RequestBuilder} instance */ protected void configureRequestBuilder(RequestBuilder builder) { builder.setHeader("Content-Type", RequestFactory.JSON_CONTENT_TYPE_UTF8); builder.setHeader("pageurl", Location.getHref()); builder.setHeader(STRONG_NAME_HEADER, GWT.getPermutationStrongName()); }
String buildResultsPageUrl(StemCellSearchRequest request) { // FIXME yuck, there must be a better way (GWT methods don't get us the correct html page) final String href = Window.Location.getHref(); final String baseUrl = href.substring( 0, href.indexOf( "#" ) ); return ( baseUrl + "#" + PageMode.results.getToken() + request.toUrlParams() ); } }
@Override public void onChange(ChangeEvent event) { String selectedLanguage = display.getSelectedLanguage().getFirst(); display.setSelectedLanguage(selectedLanguage); Cookies.setCookie(LoginConstants.LANGUAGE_COOKIE_NAME, selectedLanguage); unbind(); RootPanel.get().clear(); Location.assign(URLUtils.transformURLToRequiredLocale(Location.getHref(), Location.getHostName(), null, LocaleInfo.getCurrentLocale().getLocaleName(), selectedLanguage)); } }));
public void onClick(ClickEvent evt) { String currentUrl = Window.Location.getHref(); String permalink = createPermaLink(currentUrl); Window.Location.assign(addDesignOptions(permalink)); }
/** * Override to change the headers sent in the HTTP request. * * @param builder a {@link RequestBuilder} instance */ protected void configureRequestBuilder(RequestBuilder builder) { builder.setHeader("Content-Type", RequestFactory.JSON_CONTENT_TYPE_UTF8); builder.setHeader("pageurl", Location.getHref()); builder.setHeader(STRONG_NAME_HEADER, GWT.getPermutationStrongName()); }
@Override public void onClick(ClickEvent clickEvent) { String url = Window.Location.getHref(); Window.open("/kaaAdmin/servlet/kaaConfigurationDownloadServlet?schemaId=" + Utils.getSchemaIdFromUrl(url) + "&endGroupId=" + Utils.getEndpointGroupIdFromUrl(url), "_blank", "status=0,toolbar=0,menubar=0,location=0"); } });