use of io.jmix.ui.Screens in project jmix by jmix-framework.
the class ScreenFacetImpl method createScreen.
protected S createScreen(FrameOwner frameOwner) {
S screen;
Screens screens = UiControllerUtils.getScreenContext(frameOwner).getScreens();
if (screenId != null) {
screen = (S) screens.create(screenId, openMode, getScreenOptions());
} else if (screenClass != null) {
screen = screens.create(screenClass, openMode, getScreenOptions());
} else {
throw new DevelopmentException("Unable to open screen because no screen id or screen class are specified");
}
return screen;
}
use of io.jmix.ui.Screens in project jmix by jmix-framework.
the class LocalizedTaskWrapper method handleException.
@Override
public boolean handleException(Exception ex) {
boolean handled = wrappedTask.handleException(ex);
if (handled || wrappedTask.getOwnerScreen() == null) {
Screens screens = getScreenContext().getScreens();
screens.remove(screen);
} else {
Screens screens = getScreenContext().getScreens();
screens.remove(screen);
showExecutionError(ex);
log.error("Exception occurred in background task", ex);
handled = true;
}
return handled;
}
use of io.jmix.ui.Screens in project jmix by jmix-framework.
the class LocalizedTaskWrapper method handleTimeoutException.
@Override
public boolean handleTimeoutException() {
boolean handled = wrappedTask.handleTimeoutException();
if (handled || wrappedTask.getOwnerScreen() == null) {
Screens screens = getScreenContext().getScreens();
screens.remove(screen);
} else {
Screens screens = getScreenContext().getScreens();
screens.remove(screen);
Notifications notifications = getScreenContext().getNotifications();
notifications.create(Notifications.NotificationType.WARNING).withCaption(messages.getMessage(LocalizedTaskWrapper.class, "backgroundWorkProgress.timeout")).withDescription(messages.getMessage(LocalizedTaskWrapper.class, "backgroundWorkProgress.timeoutMessage")).show();
handled = true;
}
return handled;
}
Aggregations