use of io.jmix.ui.component.impl.WindowImpl in project jmix by jmix-framework.
the class WindowBreadCrumbs method isCloseWithCloseButtonPrevented.
protected boolean isCloseWithCloseButtonPrevented(@Nullable Window currentWindow) {
WindowImpl windowImpl = (WindowImpl) currentWindow;
if (windowImpl != null) {
Window.BeforeCloseEvent event = new Window.BeforeCloseEvent(windowImpl, CloseOriginType.CLOSE_BUTTON);
windowImpl.fireBeforeClose(event);
return event.isClosePrevented();
}
return false;
}
use of io.jmix.ui.component.impl.WindowImpl in project jmix by jmix-framework.
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());
((WindowImpl) notFoundScreen.getWindow()).setResolvedState(state);
notFoundScreen.show();
}
use of io.jmix.ui.component.impl.WindowImpl in project jmix by jmix-framework.
the class ScreenNavigationHandler method openScreen.
protected void openScreen(NavigationState requestedState, String screenRoute, WindowInfo windowInfo, AppUI ui) {
UrlChangeHandler urlChangeHandler = ui.getUrlChangeHandler();
if (!urlChangeHandler.isPermittedToNavigate(requestedState, windowInfo)) {
return;
}
Screen screen = createScreen(requestedState, screenRoute, windowInfo, ui);
if (screen == null) {
log.info("Unable to open screen '{}' for requested route '{}'", windowInfo.getId(), requestedState.getNestedRoute());
urlChangeHandler.revertNavigationState();
return;
}
if (requestedState.getNestedRoute().endsWith(screenRoute)) {
Map<String, String> params = requestedState.getParams();
if (MapUtils.isNotEmpty(params)) {
UiControllerUtils.fireEvent(screen, UrlParamsChangedEvent.class, new UrlParamsChangedEvent(screen, params));
}
((WindowImpl) screen.getWindow()).setResolvedState(requestedState);
} else {
((WindowImpl) screen.getWindow()).setResolvedState(getNestedScreenState(screenRoute, requestedState));
}
screen.show();
}
use of io.jmix.ui.component.impl.WindowImpl in project jmix by jmix-framework.
the class WebUrlRouting method getStateMark.
protected String getStateMark(Screen screen) {
WindowImpl windowImpl = (WindowImpl) screen.getWindow();
NavigationState resolvedState = windowImpl.getResolvedState();
return resolvedState != null ? resolvedState.getStateMark() : NavigationState.EMPTY.getStateMark();
}
use of io.jmix.ui.component.impl.WindowImpl in project jmix by jmix-framework.
the class UrlChangeHandler method getStateMark.
protected String getStateMark(Screen screen) {
WindowImpl windowImpl = (WindowImpl) screen.getWindow();
NavigationState resolvedState = windowImpl.getResolvedState();
return resolvedState != null ? resolvedState.getStateMark() : NavigationState.EMPTY.getStateMark();
}
Aggregations