use of com.haulmont.cuba.gui.UrlRouting in project cuba by cuba-platform.
the class AppUI method setApplicationContext.
@Inject
protected void setApplicationContext(ApplicationContext applicationContext) {
Dialogs dialogs = new WebDialogs(this);
autowireContext(dialogs, applicationContext);
setDialogs(dialogs);
Notifications notifications = new WebNotifications(this);
autowireContext(notifications, applicationContext);
setNotifications(notifications);
WebBrowserTools webBrowserTools = new WebBrowserToolsImpl(this);
autowireContext(webBrowserTools, applicationContext);
setWebBrowserTools(webBrowserTools);
Fragments fragments = new WebFragments(this);
autowireContext(fragments, applicationContext);
setFragments(fragments);
Screens screens = new WebScreens(this);
autowireContext(screens, applicationContext);
setScreens(screens);
UrlRouting urlRouting = new WebUrlRouting(this);
autowireContext(urlRouting, applicationContext);
setUrlRouting(urlRouting);
History history = new WebHistory(this);
autowireContext(history, applicationContext);
setHistory(history);
UrlChangeHandler urlChangeHandler = new UrlChangeHandler(this);
autowireContext(urlChangeHandler, applicationContext);
setUrlChangeHandler(urlChangeHandler);
getPage().addPopStateListener(urlChangeHandler::handleUrlChange);
}
use of com.haulmont.cuba.gui.UrlRouting in project cuba by cuba-platform.
the class WebAppWorkArea method reflectTabChangeToUrl.
protected void reflectTabChangeToUrl(boolean userOriginated) {
if (!userOriginated) {
return;
}
Component selectedTab = tabbedContainer.getTabSheetBehaviour().getSelectedTab();
if (selectedTab == null) {
return;
}
Window selectedWindow = ((TabWindowContainer) selectedTab).getBreadCrumbs().getCurrentWindow();
WebWindow webWindow = (WebWindow) selectedWindow;
NavigationState resolvedState = webWindow.getResolvedState();
if (resolvedState != null) {
int stateMark = generateUrlStateMark();
NavigationState newState = new NavigationState(resolvedState.getRoot(), String.valueOf(stateMark), resolvedState.getNestedRoute(), resolvedState.getParams());
webWindow.setResolvedState(newState);
Screen screen = selectedWindow.getFrameOwner();
UrlRouting urlRouting = UiControllerUtils.getScreenContext(screen).getUrlRouting();
urlRouting.pushState(screen, newState.getParams());
}
}
Aggregations