Search in sources :

Example 21 with NavigationState

use of com.haulmont.cuba.gui.navigation.NavigationState in project cuba by cuba-platform.

the class ScreenNavigationHandler method handle404.

protected void handle404(String route, AppUI ui) {
    MapScreenOptions options = new MapScreenOptions(ParamsMap.of("requestedRoute", route));
    NotFoundScreen notFoundScreen = ui.getScreens().create(NotFoundScreen.class, OpenMode.NEW_TAB, options);
    NavigationState state = new NavigationState(ui.getUrlRouting().getState().getRoot(), "", route, Collections.emptyMap());
    ((WebWindow) notFoundScreen.getWindow()).setResolvedState(state);
    notFoundScreen.show();
}
Also used : NavigationState(com.haulmont.cuba.gui.navigation.NavigationState) MapScreenOptions(com.haulmont.cuba.gui.screen.MapScreenOptions) NotFoundScreen(com.haulmont.cuba.web.app.ui.navigation.notfoundwindow.NotFoundScreen) WebWindow(com.haulmont.cuba.web.gui.WebWindow)

Aggregations

NavigationState (com.haulmont.cuba.gui.navigation.NavigationState)21 WebWindow (com.haulmont.cuba.web.gui.WebWindow)9 Screen (com.haulmont.cuba.gui.screen.Screen)6 Nullable (javax.annotation.Nullable)4 NotFoundScreen (com.haulmont.cuba.web.app.ui.navigation.notfoundwindow.NotFoundScreen)3 UrlChangeHandler (com.haulmont.cuba.web.sys.navigation.UrlChangeHandler)3 RootWindow (com.haulmont.cuba.gui.components.RootWindow)2 WindowInfo (com.haulmont.cuba.gui.config.WindowInfo)2 UrlParamsChangedEvent (com.haulmont.cuba.gui.navigation.UrlParamsChangedEvent)2 EditorScreen (com.haulmont.cuba.gui.screen.EditorScreen)2 MapScreenOptions (com.haulmont.cuba.gui.screen.MapScreenOptions)2 Matcher (java.util.regex.Matcher)2 Pair (com.haulmont.bali.datastruct.Pair)1 ParamsMap (com.haulmont.bali.util.ParamsMap)1 Preconditions.checkNotEmptyString (com.haulmont.bali.util.Preconditions.checkNotEmptyString)1 MetaClass (com.haulmont.chile.core.model.MetaClass)1 MetaProperty (com.haulmont.chile.core.model.MetaProperty)1 Entity (com.haulmont.cuba.core.entity.Entity)1 com.haulmont.cuba.core.global (com.haulmont.cuba.core.global)1 UrlRouting (com.haulmont.cuba.gui.UrlRouting)1