Search in sources :

Example 61 with WindowInfo

use of com.haulmont.cuba.gui.config.WindowInfo in project cuba by cuba-platform.

the class ScreenNavigationHandler method navigate.

protected boolean navigate(NavigationState requestedState, AppUI ui, List<Pair<String, WindowInfo>> routeWindowInfos) {
    int subRouteIdx = 0;
    NavigationState currentState = ui.getHistory().getNow();
    for (Pair<String, WindowInfo> entry : routeWindowInfos) {
        String subRoute = entry.getFirst();
        if (skipSubRoute(requestedState, subRouteIdx, currentState, subRoute)) {
            subRouteIdx++;
            continue;
        }
        WindowInfo windowInfo = entry.getSecond();
        openScreen(requestedState, subRoute, windowInfo, ui);
        subRouteIdx++;
    }
    return true;
}
Also used : NavigationState(com.haulmont.cuba.gui.navigation.NavigationState) WindowInfo(com.haulmont.cuba.gui.config.WindowInfo)

Example 62 with WindowInfo

use of com.haulmont.cuba.gui.config.WindowInfo in project cuba by cuba-platform.

the class HasWindowManager method openEditor.

/**
 * Open an edit screen for entity instance. <br> It is recommended to use {@link ScreenBuilders} bean instead.
 *
 * @param item        entity to edit
 * @param openType    how to open the screen
 * @param params      parameters to pass to {@code init()} method of the screen's controller
 * @return created window
 */
@Deprecated
default AbstractEditor openEditor(Entity item, WindowManager.OpenType openType, Map<String, Object> params) {
    WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
    WindowInfo editorScreen = windowConfig.getEditorScreen(item);
    return (AbstractEditor) getWindowManager().openEditor(editorScreen, item, openType, params);
}
Also used : WindowConfig(com.haulmont.cuba.gui.config.WindowConfig) WindowInfo(com.haulmont.cuba.gui.config.WindowInfo)

Example 63 with WindowInfo

use of com.haulmont.cuba.gui.config.WindowInfo in project cuba by cuba-platform.

the class HasWindowManager method openLookup.

/**
 * Open a lookup screen. <br> It is recommended to use {@link ScreenBuilders} bean instead.
 *
 * @param entityClass required class of entity
 * @param handler     is invoked when selection confirmed and the lookup screen closes
 * @param openType    how to open the screen
 * @param params      parameters to pass to {@code init()} method of the screen's controller
 * @return created window
 */
@Deprecated
default AbstractLookup openLookup(Class<? extends Entity> entityClass, Window.Lookup.Handler handler, WindowManager.OpenType openType, Map<String, Object> params) {
    WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
    WindowInfo lookupScreen = windowConfig.getLookupScreen(entityClass);
    return (AbstractLookup) getWindowManager().openLookup(lookupScreen, handler, openType, params);
}
Also used : WindowConfig(com.haulmont.cuba.gui.config.WindowConfig) WindowInfo(com.haulmont.cuba.gui.config.WindowInfo)

Example 64 with WindowInfo

use of com.haulmont.cuba.gui.config.WindowInfo in project cuba by cuba-platform.

the class HasWindowManager method openEditor.

/**
 * Open an edit screen for entity instance. <br> It is recommended to use {@link ScreenBuilders} bean instead.
 *
 * @param item        entity to edit
 * @param openType    how to open the screen
 * @return created window
 */
@Deprecated
default AbstractEditor openEditor(Entity item, WindowManager.OpenType openType) {
    WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
    WindowInfo editorScreen = windowConfig.getEditorScreen(item);
    return (AbstractEditor) getWindowManager().openEditor(editorScreen, item, openType);
}
Also used : WindowConfig(com.haulmont.cuba.gui.config.WindowConfig) WindowInfo(com.haulmont.cuba.gui.config.WindowInfo)

Example 65 with WindowInfo

use of com.haulmont.cuba.gui.config.WindowInfo in project cuba by cuba-platform.

the class HasWindowManager method openFrame.

/**
 * Load a frame registered in {@code screens.xml} and optionally show it inside a parent component of this
 * frame. <br> It is recommended to use {@link Fragments} bean instead.
 *
 * @param parent        if specified, all parent's sub components will be removed and the frame will be added
 * @param windowAlias   frame ID as defined in {@code screens.xml}
 * @return              frame's controller instance
 */
@Deprecated
default Frame openFrame(@Nullable Component parent, String windowAlias) {
    WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
    WindowInfo windowInfo = windowConfig.getWindowInfo(windowAlias);
    Frame parentFrame;
    if (this instanceof LegacyFrame) {
        parentFrame = ((LegacyFrame) this).getWrappedFrame();
    } else {
        parentFrame = ((Frame) this);
    }
    return getWindowManager().openFrame(parentFrame, parent, windowInfo);
}
Also used : WindowConfig(com.haulmont.cuba.gui.config.WindowConfig) LegacyFrame(com.haulmont.cuba.gui.screen.compatibility.LegacyFrame) LegacyFrame(com.haulmont.cuba.gui.screen.compatibility.LegacyFrame) WindowInfo(com.haulmont.cuba.gui.config.WindowInfo)

Aggregations

WindowInfo (com.haulmont.cuba.gui.config.WindowInfo)74 WindowConfig (com.haulmont.cuba.gui.config.WindowConfig)43 WebWindowManager (com.haulmont.cuba.web.WebWindowManager)15 WindowManager (com.haulmont.cuba.gui.WindowManager)9 Element (org.dom4j.Element)8 Window (com.haulmont.cuba.gui.components.Window)7 LegacyFrame (com.haulmont.cuba.gui.screen.compatibility.LegacyFrame)5 HashMap (java.util.HashMap)5 Screens (com.haulmont.cuba.gui.Screens)3 FrameOwner (com.haulmont.cuba.gui.screen.FrameOwner)3 LayoutLoader (com.haulmont.cuba.gui.xml.layout.LayoutLoader)3 com.haulmont.cuba.core.global (com.haulmont.cuba.core.global)2 DetachedFrame (com.haulmont.cuba.desktop.DetachedFrame)2 GuiDevelopmentException (com.haulmont.cuba.gui.GuiDevelopmentException)2 Notifications (com.haulmont.cuba.gui.Notifications)2 OpenType (com.haulmont.cuba.gui.WindowManager.OpenType)2 Filter (com.haulmont.cuba.gui.components.Filter)2 Fragment (com.haulmont.cuba.gui.components.Fragment)2 RelatedAction (com.haulmont.cuba.gui.components.actions.RelatedAction)2 AddConditionWindow (com.haulmont.cuba.gui.components.filter.addcondition.AddConditionWindow)2