Search in sources :

Example 41 with Screen

use of com.haulmont.cuba.gui.screen.Screen in project cuba by cuba-platform.

the class App method createTopLevelWindow.

/**
 * Called on each browser tab initialization.
 */
public void createTopLevelWindow(AppUI ui) {
    String topLevelWindowId = routeTopLevelWindowId();
    Screens screens = ui.getScreens();
    Screen screen = screens.create(topLevelWindowId, OpenMode.ROOT);
    screens.show(screen);
}
Also used : Screen(com.haulmont.cuba.gui.screen.Screen) Screens(com.haulmont.cuba.gui.Screens)

Example 42 with Screen

use of com.haulmont.cuba.gui.screen.Screen in project cuba by cuba-platform.

the class App method navigateTo.

/**
 * Initialize new TopLevelWindow and replace current.
 *
 * @param topLevelWindowId target top level window id
 * @deprecated Use {@link Screens#create(Class, Screens.LaunchMode)} with {@link OpenMode#ROOT}
 */
@Deprecated
public void navigateTo(String topLevelWindowId) {
    AppUI ui = AppUI.getCurrent();
    WindowInfo windowInfo = windowConfig.getWindowInfo(topLevelWindowId);
    Screens screens = ui.getScreens();
    Screen screen = screens.create(windowInfo.asScreen(), OpenMode.ROOT);
    screens.show(screen);
}
Also used : Screen(com.haulmont.cuba.gui.screen.Screen) Screens(com.haulmont.cuba.gui.Screens) WindowInfo(com.haulmont.cuba.gui.config.WindowInfo)

Example 43 with Screen

use of com.haulmont.cuba.gui.screen.Screen in project cuba by cuba-platform.

the class AbstractComponentLoader method getWindowId.

@Nullable
protected String getWindowId(Context context) {
    if (context instanceof ComponentContext) {
        Frame frame = getComponentContext().getFrame();
        Screen screen = UiControllerUtils.getScreen(frame.getFrameOwner());
        return screen.getId();
    }
    return null;
}
Also used : LegacyFrame(com.haulmont.cuba.gui.screen.compatibility.LegacyFrame) Screen(com.haulmont.cuba.gui.screen.Screen) Nullable(javax.annotation.Nullable)

Example 44 with Screen

use of com.haulmont.cuba.gui.screen.Screen in project cuba by cuba-platform.

the class WebFilterHelper method getUiFoldersPane.

@Nullable
protected FoldersPane getUiFoldersPane() {
    AppUI ui = AppUI.getCurrent();
    Screen topLevelWindow = ui.getTopLevelWindowNN().getFrameOwner();
    if (topLevelWindow instanceof Window.HasFoldersPane) {
        return ((Window.HasFoldersPane) topLevelWindow).getFoldersPane();
    }
    return null;
}
Also used : Screen(com.haulmont.cuba.gui.screen.Screen) UiControllerUtils.getHostScreen(com.haulmont.cuba.gui.screen.UiControllerUtils.getHostScreen) AppUI(com.haulmont.cuba.web.AppUI) Nullable(javax.annotation.Nullable)

Example 45 with Screen

use of com.haulmont.cuba.gui.screen.Screen in project cuba by cuba-platform.

the class WebUrlRouting method buildDialogRoute.

protected String buildDialogRoute(Screen dialog) {
    RouteDefinition dialogRouteDefinition = getRouteDef(dialog);
    Iterator<Screen> currentTabScreens = ui.getScreens().getOpenedScreens().getCurrentBreadcrumbs().iterator();
    Screen currentScreen = currentTabScreens.hasNext() ? currentTabScreens.next() : null;
    String currentScreenRoute = currentScreen != null ? buildScreenRoute(currentScreen) : "";
    if (dialogRouteDefinition == null) {
        return currentScreenRoute;
    }
    String dialogRoute = dialogRouteDefinition.getPath();
    if (dialogRoute == null || dialogRoute.isEmpty()) {
        return currentScreenRoute;
    }
    String parentPrefix = dialogRouteDefinition.getParentPrefix();
    if (StringUtils.isNotEmpty(parentPrefix) && dialogRoute.startsWith(parentPrefix + '/') && currentScreenRoute.endsWith(parentPrefix)) {
        dialogRoute = dialogRoute.substring(parentPrefix.length() + 1);
    }
    return currentScreenRoute == null || currentScreenRoute.isEmpty() ? dialogRoute : currentScreenRoute + '/' + dialogRoute;
}
Also used : RouteDefinition(com.haulmont.cuba.gui.sys.RouteDefinition) Screen(com.haulmont.cuba.gui.screen.Screen) EditorScreen(com.haulmont.cuba.gui.screen.EditorScreen) NotFoundScreen(com.haulmont.cuba.web.app.ui.navigation.notfoundwindow.NotFoundScreen) Preconditions.checkNotEmptyString(com.haulmont.bali.util.Preconditions.checkNotEmptyString)

Aggregations

Screen (com.haulmont.cuba.gui.screen.Screen)66 WebWindow (com.haulmont.cuba.web.gui.WebWindow)18 NotFoundScreen (com.haulmont.cuba.web.app.ui.navigation.notfoundwindow.NotFoundScreen)11 GuiDialogWindow (com.haulmont.cuba.web.gui.components.WebDialogWindow.GuiDialogWindow)10 WebTabWindow (com.haulmont.cuba.web.gui.components.WebTabWindow)10 EditorScreen (com.haulmont.cuba.gui.screen.EditorScreen)9 NavigationState (com.haulmont.cuba.gui.navigation.NavigationState)8 Nullable (javax.annotation.Nullable)8 Screens (com.haulmont.cuba.gui.Screens)6 WindowInfo (com.haulmont.cuba.gui.config.WindowInfo)6 WebAppWorkArea (com.haulmont.cuba.web.gui.components.mainwindow.WebAppWorkArea)6 FrameOwner (com.haulmont.cuba.gui.screen.FrameOwner)5 AppUI (com.haulmont.cuba.web.AppUI)5 Entity (com.haulmont.cuba.core.entity.Entity)4 com.haulmont.cuba.core.global (com.haulmont.cuba.core.global)4 SelectHandlerAdapter (com.haulmont.cuba.gui.components.compatibility.SelectHandlerAdapter)4 WindowConfig (com.haulmont.cuba.gui.config.WindowConfig)4 OpenMode (com.haulmont.cuba.gui.screen.OpenMode)4 ScreenFragment (com.haulmont.cuba.gui.screen.ScreenFragment)4 UiControllerUtils (com.haulmont.cuba.gui.screen.UiControllerUtils)4