use of io.jmix.ui.component.impl.TabWindowImpl in project jmix by jmix-framework.
the class ScreensImpl method removeNewTabWindow.
protected void removeNewTabWindow(Screen screen) {
TabWindowImpl window = (TabWindowImpl) screen.getWindow();
com.vaadin.ui.Component windowComposition = window.unwrapComposition(com.vaadin.ui.Component.class);
TabWindowContainer windowContainer = (TabWindowContainer) windowComposition.getParent();
windowContainer.removeComponent(windowComposition);
AppWorkAreaImpl 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(State.INITIAL_LAYOUT);
}
}
Aggregations