use of io.jmix.ui.screen.Screen in project jmix by jmix-framework.
the class ScreensImpl method getConfiguredWorkArea.
/**
* @return workarea instance of the root screen
* @throws IllegalStateException if there is no root screen or root screen does not have {@link AppWorkArea}
*/
public AppWorkAreaImpl getConfiguredWorkArea() {
RootWindow topLevelWindow = ui.getTopLevelWindow();
if (topLevelWindow == null) {
throw new IllegalStateException("There is no root screen opened");
}
Screen controller = topLevelWindow.getFrameOwner();
if (controller instanceof HasWorkArea) {
AppWorkArea workArea = ((HasWorkArea) controller).getWorkArea();
if (workArea instanceof AppWorkAreaImpl) {
return (AppWorkAreaImpl) workArea;
}
}
throw new IllegalStateException("RootWindow does not have any configured work area");
}
use of io.jmix.ui.screen.Screen in project jmix by jmix-framework.
the class ScreensImpl method removeAll.
@Override
public void removeAll() {
List<Screen> dialogScreens = getDialogScreensStream().collect(Collectors.toList());
for (Screen dialogScreen : dialogScreens) {
remove(dialogScreen);
}
AppWorkArea workArea = getConfiguredWorkAreaOrNull();
if (workArea instanceof AppWorkAreaImpl) {
Collection<WindowStack> workAreaStacks = getWorkAreaStacks((AppWorkAreaImpl) workArea);
for (WindowStack workAreaStack : workAreaStacks) {
Collection<Screen> tabScreens = workAreaStack.getBreadcrumbs();
for (Screen screen : tabScreens) {
remove(screen);
}
}
}
}
Aggregations