/** * Clears the rootPanel. If clearDom is true, then also remove any DOM * elements that are not widgets. * * <p>By default {@link #clear()} will only remove children that are GWT widgets. * This method also provides the option to remove all children including the * non-widget DOM elements that are directly added (e.g. elements added via * {@code getElement().appendChild(...)}. * * @param clearDom if {@code true} this method will also remove any DOM * elements that are not widgets. * * @deprecated Simply removing all DOM elements can cause issues with other elements in the page. */ @Deprecated public void clear(boolean clearDom) { clear(); if (clearDom) { getElement().removeAllChildren(); } } }
/** * Clears the rootPanel. If clearDom is true, then also remove any DOM * elements that are not widgets. * * <p>By default {@link #clear()} will only remove children that are GWT widgets. * This method also provides the option to remove all children including the * non-widget DOM elements that are directly added (e.g. elements added via * {@code getElement().appendChild(...)}. * * @param clearDom if {@code true} this method will also remove any DOM * elements that are not widgets. */ public void clear(boolean clearDom) { clear(); if (clearDom) { getElement().removeAllChildren(); } } }
/** * Clears the rootPanel. If clearDom is true, then also remove any DOM * elements that are not widgets. * * <p>By default {@link #clear()} will only remove children that are GWT widgets. * This method also provides the option to remove all children including the * non-widget DOM elements that are directly added (e.g. elements added via * {@code getElement().appendChild(...)}. * * @param clearDom if {@code true} this method will also remove any DOM * elements that are not widgets. */ public void clear(boolean clearDom) { clear(); if (clearDom) { getElement().removeAllChildren(); } } }
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); } } }
@Override protected void gwtTearDown() throws Exception { super.gwtTearDown(); table = null; RootPanel.get().clear(); }
contentRoot.clear(); this.content = content; History.newItem(content.getToken(), false);
@Override protected void handleSuccessfulLogin(ClientSessionDTO result) { display.setUsername(""); display.setPassword(""); unbind(); if (redirectUrl != null && !redirectUrl.isEmpty()) { String sessionId = result.getSessionId(); String query = LoginUtils.getCommonQueryString(sessionId); closePopup(redirectUrl != null ? redirectUrl + query : null); RootPanel.get().clear(); Location.replace(redirectUrl + query); } }
@Override protected void gwtTearDown() throws Exception { super.gwtTearDown(); if(isTearDownRootPanel()) { RootPanel.get().clear(); } }
private void manageStatus(String statusMessage, boolean showStatus, boolean error) { RootPanel rootPanel = RootPanel.get("status"); rootPanel.clear(); SpanElement span = Document.get().createSpanElement(); span.setInnerText(statusMessage != null ? statusMessage : ""); rootPanel.getElement().appendChild(span); manageStatusElement(rootPanel, showStatus, error); }
@Override protected void gwtTearDown() throws Exception { super.gwtTearDown(); if(isTearDownRootPanel()) { RootPanel.get().clear(); } }
/*************************************** * Opens a URL that is relative to the current web application in an * invisible frame. This can be used to initiate downloads. * * @param sRelativeUrl A URL that is relative to the current module's base * URL */ public static void openHiddenUrl(String sRelativeUrl) { final RootPanel rRootPanel = RootPanel.get(HIDDEN_URL_FRAME); if (rRootPanel != null) { Frame aFrame = new Frame(GWT.getModuleBaseURL() + sRelativeUrl); aFrame.setVisible(false); aFrame.setSize("0px", "0px"); rRootPanel.clear(); rRootPanel.add(aFrame); } }
protected void handleSuccessfulLogin(ClientSessionDTO result) { display.setUsername(""); display.setPassword(""); if (!switchAfterLogin) { unbind(); } if (redirectUrl != null && !redirectUrl.isEmpty()) { String sessionId = result.getSessionId(); String query = LoginUtils.getCommonQueryString(sessionId); RootPanel.get().clear(); Location.replace(redirectUrl + query); } if (switchAfterLogin) { display.setLoggedUser(result.getUser()); display.changeState(true); } }
@Override public void setInSlot(Object slot, IsWidget content) { assert slot == rootSlot : "Unknown slot used in the root proxy."; if (usingRootLayoutPanel) { // TODO Next 3 lines are a dirty workaround for // http://code.google.com/p/google-web-toolkit/issues/detail?id=4737 getAppRootPanel().clear(); RootLayoutPanel.get().clear(); getAppRootPanel().add(RootLayoutPanel.get()); if (content != null) { RootLayoutPanel.get().add(content); } } else { // TODO Next 2 lines are a dirty workaround for // http://code.google.com/p/google-web-toolkit/issues/detail?id=4737 RootLayoutPanel.get().clear(); getAppRootPanel().clear(); if (content != null) { getAppRootPanel().add(content); } } }
public final void onResourceLoad() { JavaScriptObject json = loadResource(); if (json != null) { if (WSUtils.getINSTANCE() == null) { WSUtils.setInstance(new GwtUtils()); // TODO dirty hack to initialize WSUtils } String jsonStr = (new JSONObject(json)).toString(); Resource resource = RESOURCE_UNMARSHALLER.toModel(jsonStr); RootPanel container = getRootPanel(); container.clear(); Widget currentWidget = doOnResourceLoad(resource); if (currentWidget != null) { container.add(currentWidget); } } }
@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)); } }));
@Override public void onSuccess(AuthenticationUser user) { errorLabel.setText(""); errorLabel.setVisible(false); GWT.log("Login screen: loginUser onSuccess called"); if (user.isAuthenticated()) { RootPanel.get(browserElementId).clear(); // Call the user-provided handler; let 'em know login succeeded loginHandler.onSuccess(user); } else { GWT.log("Authentication failure: " + user.getErrorMessage()); errorLabel.setVisible(true); errorLabel.setText("Authentication failure: " + user.getErrorMessage()); loginButton.setEnabled(true); } } }