Search in sources :

Example 16 with Screens

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;
}
Also used : Screens(io.jmix.ui.Screens) DevelopmentException(io.jmix.core.DevelopmentException)

Example 17 with Screens

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;
}
Also used : Screens(io.jmix.ui.Screens)

Example 18 with Screens

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;
}
Also used : Screens(io.jmix.ui.Screens) Notifications(io.jmix.ui.Notifications)

Aggregations

Screens (io.jmix.ui.Screens)18 FrameOwner (io.jmix.ui.screen.FrameOwner)5 Screen (io.jmix.ui.screen.Screen)4 Notifications (io.jmix.ui.Notifications)3 HashMap (java.util.HashMap)3 WindowManager (com.haulmont.cuba.gui.WindowManager)2 EntityInfoWindow (io.jmix.datatoolsui.screen.entityinfo.EntityInfoWindow)2 WindowConfig (io.jmix.ui.WindowConfig)2 WindowInfo (io.jmix.ui.WindowInfo)2 LayoutAnalyzer (io.jmix.ui.app.core.dev.LayoutAnalyzer)2 LayoutAnalyzerScreen (io.jmix.ui.app.core.dev.LayoutAnalyzerScreen)2 LayoutTip (io.jmix.ui.app.core.dev.LayoutTip)2 io.jmix.ui.component (io.jmix.ui.component)2 ContainerDataUnit (io.jmix.ui.component.data.meta.ContainerDataUnit)2 MapScreenOptions (io.jmix.ui.screen.MapScreenOptions)2 CubaLegacySettings (com.haulmont.cuba.settings.CubaLegacySettings)1 AbstractComponent (com.vaadin.ui.AbstractComponent)1 MenuBar (com.vaadin.ui.MenuBar)1 DevelopmentException (io.jmix.core.DevelopmentException)1 MetaClass (io.jmix.core.metamodel.model.MetaClass)1