use of com.haulmont.cuba.web.gui.components.WebTabWindow in project cuba by cuba-platform.
the class WebScreens method removeNewTabWindow.
protected void removeNewTabWindow(Screen screen) {
WebTabWindow window = (WebTabWindow) screen.getWindow();
com.vaadin.ui.Component windowComposition = window.unwrapComposition(com.vaadin.ui.Component.class);
TabWindowContainer windowContainer = (TabWindowContainer) windowComposition.getParent();
windowContainer.removeComponent(windowComposition);
WebAppWorkArea workArea = getConfiguredWorkArea();
boolean allWindowsRemoved;
if (workArea.getMode() == Mode.TABBED) {
TabSheetBehaviour tabSheet = workArea.getTabbedWindowContainer().getTabSheetBehaviour();
tabSheet.silentCloseTabAndSelectPrevious(windowContainer);
tabSheet.removeComponent(windowContainer);
allWindowsRemoved = tabSheet.getComponentCount() == 0;
} else {
Layout singleLayout = workArea.getSingleWindowContainer();
singleLayout.removeComponent(windowContainer);
allWindowsRemoved = true;
}
WindowBreadCrumbs windowBreadCrumbs = windowContainer.getBreadCrumbs();
if (windowBreadCrumbs != null) {
windowBreadCrumbs.setWindowNavigateHandler(null);
windowBreadCrumbs.removeWindow();
}
if (allWindowsRemoved) {
workArea.switchTo(AppWorkArea.State.INITIAL_LAYOUT);
}
}
Aggregations