Search in sources :

Example 66 with Screen

use of com.haulmont.cuba.gui.screen.Screen in project cuba by cuba-platform.

the class ParamsNavigationHandler method doHandle.

@Override
public boolean doHandle(NavigationState requestedState, AppUI ui) {
    UrlChangeHandler urlChangeHandler = ui.getUrlChangeHandler();
    if (urlChangeHandler.isEmptyState(requestedState)) {
        return false;
    }
    Screen screen = urlChangeHandler.getActiveScreen();
    if (screen == null) {
        log.debug("Unable to find a screen for state: '{}", requestedState);
        return false;
    }
    Map<String, String> params = requestedState.getParams() != null ? requestedState.getParams() : Collections.emptyMap();
    WebWindow window = (WebWindow) screen.getWindow();
    NavigationState resolvedState = window.getResolvedState();
    if (resolvedState == null || params.equals(resolvedState.getParams())) {
        return false;
    }
    NavigationState newState = new NavigationState(resolvedState.getRoot(), resolvedState.getStateMark(), resolvedState.getNestedRoute(), params);
    window.setResolvedState(newState);
    UiControllerUtils.fireEvent(screen, UrlParamsChangedEvent.class, new UrlParamsChangedEvent(screen, params));
    return true;
}
Also used : UrlParamsChangedEvent(com.haulmont.cuba.gui.navigation.UrlParamsChangedEvent) Screen(com.haulmont.cuba.gui.screen.Screen) NavigationState(com.haulmont.cuba.gui.navigation.NavigationState) UrlChangeHandler(com.haulmont.cuba.web.sys.navigation.UrlChangeHandler) WebWindow(com.haulmont.cuba.web.gui.WebWindow)

Aggregations

Screen (com.haulmont.cuba.gui.screen.Screen)66 WebWindow (com.haulmont.cuba.web.gui.WebWindow)18 NotFoundScreen (com.haulmont.cuba.web.app.ui.navigation.notfoundwindow.NotFoundScreen)11 GuiDialogWindow (com.haulmont.cuba.web.gui.components.WebDialogWindow.GuiDialogWindow)10 WebTabWindow (com.haulmont.cuba.web.gui.components.WebTabWindow)10 EditorScreen (com.haulmont.cuba.gui.screen.EditorScreen)9 NavigationState (com.haulmont.cuba.gui.navigation.NavigationState)8 Nullable (javax.annotation.Nullable)8 Screens (com.haulmont.cuba.gui.Screens)6 WindowInfo (com.haulmont.cuba.gui.config.WindowInfo)6 WebAppWorkArea (com.haulmont.cuba.web.gui.components.mainwindow.WebAppWorkArea)6 FrameOwner (com.haulmont.cuba.gui.screen.FrameOwner)5 AppUI (com.haulmont.cuba.web.AppUI)5 Entity (com.haulmont.cuba.core.entity.Entity)4 com.haulmont.cuba.core.global (com.haulmont.cuba.core.global)4 SelectHandlerAdapter (com.haulmont.cuba.gui.components.compatibility.SelectHandlerAdapter)4 WindowConfig (com.haulmont.cuba.gui.config.WindowConfig)4 OpenMode (com.haulmont.cuba.gui.screen.OpenMode)4 ScreenFragment (com.haulmont.cuba.gui.screen.ScreenFragment)4 UiControllerUtils (com.haulmont.cuba.gui.screen.UiControllerUtils)4