/** * Hide the page currently displayed and call the associated lifecycle methods. * * @param requestPage the next requested page, this can be null if there is none. */ private void hideCurrentPage(Object requestPage, NavigationControl control) { final IsWidget currentContent = navigatingContainer.getWidget(); // Note: Optimized out in production mode if (currentPage != null && (currentContent == null || currentWidget.asWidget() != currentContent)) { // This could happen if someone was manipulating the DOM behind our backs GWT.log("Current content widget vanished or changed. " + "Not delivering pageHiding event to " + currentPage + "."); } DelegationControl hideControl = new DelegationControl(() -> { if (currentPage != null && currentComponent != null) { currentPage.pageHidden(currentComponent); currentPage.destroy(currentComponent); } control.proceed(); }); if (currentComponent != null) { contentDelegation.hideContent(currentComponent, navigatingContainer, currentWidget, requestPage, hideControl); } else { navigatingContainer.clear(); hideControl.proceed(); } }
/** * Hide the page currently displayed and call the associated lifecycle methods. * * @param requestPage the next requested page, this can be null if there is none. */ private void hideCurrentPage(Object requestPage, NavigationControl control) { final IsWidget currentContent = navigatingContainer.getWidget(); // Note: Optimized out in production mode if (currentPage != null && (currentContent == null || currentWidget.asWidget() != currentContent)) { // This could happen if someone was manipulating the DOM behind our backs GWT.log("Current content widget vanished or changed. " + "Not delivering pageHiding event to " + currentPage + "."); } DelegationControl hideControl = new DelegationControl(() -> { if (currentPage != null && currentComponent != null) { currentPage.pageHidden(currentComponent); currentPage.destroy(currentComponent); } control.proceed(); }); if (currentComponent != null) { contentDelegation.hideContent(currentComponent, navigatingContainer, currentWidget, requestPage, hideControl); } else { navigatingContainer.clear(); hideControl.proceed(); } }