private void redirectToModule(String module) { String path = Window.Location.getPath(); if (!path.endsWith("/")) { if (path.endsWith(".html") || path.endsWith(".htm")) { int index = path.lastIndexOf('/'); path = path.substring(0, index + 1); } else { path += "/"; } } String target = path + module + "/"; Window.Location.assign(Window.Location.createUrlBuilder().setPath(target).buildString()); }
/** * Redirect to module. * * @param module the module name. */ public static void redirectToModule(String module) { String path = Window.Location.getPath(); if (!path.endsWith("/")) { if (path.endsWith(".html") || path.endsWith(".htm")) { int index = path.lastIndexOf('/'); path = path.substring(0, index + 1); } else { path += "/"; } } String target = path + module + "/"; Window.Location.assign(Window.Location.createUrlBuilder().setPath(target).buildString()); }
private String getCapaUrl() { UrlBuilder builder = Window.Location.createUrlBuilder(); String url = builder.buildString(); int pos = url.indexOf("index.html"); url = url.substring(0, pos) + "tms_capa.xml"; return url; } }
String param = Window.Location.createUrlBuilder().setParameter("locale", language.getValue()).buildString(); Window.Location.replace(param);
private void setCurrentLanguage( final String languageName, final UserWorkbenchPreferences response ) { String isRefresh = Window.Location.getParameter( "isRefresh" ); if ( response != null && ( isRefresh == null || isRefresh.equals( "" ) ) ) { Window.Location.assign( Window.Location.createUrlBuilder() .removeParameter( getLocaleQueryParam() ) .setParameter( getCurrentLocaleQueryParam(), languageName ) .setParameter( "isRefresh", "false" ) .buildString() ); } else if ( response == null ) { Window.Location.assign( Window.Location.createUrlBuilder() .removeParameter( getLocaleQueryParam() ) .setParameter( getCurrentLocaleQueryParam(), languageName ) .buildString() ); } }
@Override public void configurationSetting(final boolean isInit) { String languageName = languageItem.getSelectedItem().getK2(); String isRefresh = Window.Location.getParameter("isRefresh"); if ((isRefresh == null || isRefresh.equals("")) && isInit) { Window.Location.assign(Window.Location.createUrlBuilder() .removeParameter(LocaleInfo.getLocaleQueryParam()) .setParameter(LocaleInfo.getCurrentLocale().getLocaleQueryParam(), languageName) .setParameter("isRefresh", "false") .buildString()); } else if (!isInit) { Window.Location.assign(Window.Location.createUrlBuilder() .removeParameter(LocaleInfo.getLocaleQueryParam()) .setParameter(LocaleInfo.getCurrentLocale().getLocaleQueryParam(), languageName) .buildString()); } }
public static String localeUrl(ApplicationLocale applicationLocale) { // We use the sub-delim '+' extensively in fragment identifiers, // for example: // #data-entry/Activity+53432 // UrlBuilder will decode and re-encode this resulting in // #data-entry/Activity%2053432 // Which will break navigation // So we will first construct the url without the hash, // and then append the already-encoded fragment identifier directly String url = Window.Location.createUrlBuilder() .setParameter("locale", applicationLocale.getCode()) .setHash(null) .buildString(); return url + Window.Location.getHash(); }
public static String localeUrl(ApplicationLocale applicationLocale) { // We use the sub-delim '+' extensively in fragment identifiers, // for example: // #data-entry/Activity+53432 // UrlBuilder will decode and re-encode this resulting in // #data-entry/Activity%2053432 // Which will break navigation // So we will first construct the url without the hash, // and then append the already-encoded fragment identifier directly String url = Window.Location.createUrlBuilder() .setParameter("locale", applicationLocale.getCode()) .setHash(null) .buildString(); return url + Window.Location.getHash(); }
@Override public IsUrlBuilder createUrlBuilder() { return new GwtUrlBuilder(Window.Location.createUrlBuilder()); }
private void openTable(SelectEvent event) { if(treeView.getSelectedEntry().isLoaded() && treeView.getSelectedEntry().get().isPresent()) { CatalogEntry catalogEntry = treeView.getSelectedEntry().get().get(); if(catalogEntry.getType() == CatalogEntryType.FORM) { String url = Window.Location.createUrlBuilder().setHash("table/" + catalogEntry.getId()).buildString(); Window.open(url, null, null); } else if(catalogEntry.getType() == CatalogEntryType.ANALYSIS) { String url = Window.Location.createUrlBuilder().setHash("analysis/" + catalogEntry.getId()).buildString(); Window.open(url, null, null); } } }
public static void open(ResourceId formId, ResourceId recordId) { String printUrl = Window.Location.createUrlBuilder() .setHash("print/form/" + formId.asString() + "/" + recordId.asString()).buildString(); Window.open(printUrl, "_blank", ""); } }
@Override public void replaceState(String data, String title, String url) { UrlBuilder builder = Window.Location.createUrlBuilder(); builder.setHash(data); Window.Location.replace(builder.buildString()); }
private void onImport(SelectEvent event) { // Redirect to old app for the moment. UrlBuilder importUrl = Window.Location.createUrlBuilder(); importUrl.setHash("#import/" + viewModel.getFormId().asString()); importUrl.removeParameter("ui"); Window.open(importUrl.buildString(), "_blank", null); }
private String getCapaUrl() { UrlBuilder builder = Window.Location.createUrlBuilder(); String url = builder.buildString(); int pos = url.indexOf("index.html"); url = url.substring(0, pos) + "d/tms/1.0.0"; return url; } }
public static void showSampleInNewTab(ShowcaseSampleDefinition sample) { UrlBuilder urlBuilder = Window.Location.createUrlBuilder(); urlBuilder.setParameter("sample", sample.getKey()); String url = urlBuilder.buildString(); Window.open(url, sample.getTitle(), ""); }
@Override public void replaceState(String data, String title, String url) { UrlBuilder builder = Window.Location.createUrlBuilder(); builder.setHash(data); Window.Location.replace(builder.buildString()); }