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);
}
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);
}
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;
}
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;
}
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;
}
Aggregations