Search in sources :

Example 1 with ScreenEditorWrapper

use of com.haulmont.cuba.gui.screen.compatibility.ScreenEditorWrapper in project jmix by jmix-framework.

the class CubaScreens method openEditor.

@Override
public com.haulmont.cuba.gui.components.Window.Editor openEditor(WindowInfo windowInfo, Entity item, OpenType openType, Map<String, Object> params) {
    Screen editor = createEditor(windowInfo, item, openType, params);
    editor.show();
    return editor instanceof com.haulmont.cuba.gui.components.Window.Editor ? (com.haulmont.cuba.gui.components.Window.Editor) editor : new ScreenEditorWrapper(editor);
}
Also used : LookupScreen(io.jmix.ui.screen.LookupScreen) EditorScreen(io.jmix.ui.screen.EditorScreen) Screen(io.jmix.ui.screen.Screen) ScreenEditorWrapper(com.haulmont.cuba.gui.screen.compatibility.ScreenEditorWrapper)

Example 2 with ScreenEditorWrapper

use of com.haulmont.cuba.gui.screen.compatibility.ScreenEditorWrapper in project jmix by jmix-framework.

the class CubaScreens method openEditor.

@Override
public com.haulmont.cuba.gui.components.Window.Editor openEditor(WindowInfo windowInfo, Entity item, OpenType openType) {
    Map<String, Object> params = createParametersMap(windowInfo, Collections.singletonMap(WindowParams.ITEM.name(), item));
    MapScreenOptions options = new MapScreenOptions(params);
    Screen screen = createScreen(windowInfo, openType.getOpenMode(), options);
    applyOpenTypeParameters(screen.getWindow(), openType);
    EditorScreen editorScreen = (EditorScreen) screen;
    editorScreen.setEntityToEdit(item);
    show(screen);
    return screen instanceof com.haulmont.cuba.gui.components.Window.Editor ? (com.haulmont.cuba.gui.components.Window.Editor) screen : new ScreenEditorWrapper(screen);
}
Also used : EditorScreen(io.jmix.ui.screen.EditorScreen) LookupScreen(io.jmix.ui.screen.LookupScreen) EditorScreen(io.jmix.ui.screen.EditorScreen) Screen(io.jmix.ui.screen.Screen) MapScreenOptions(io.jmix.ui.screen.MapScreenOptions) ScreenEditorWrapper(com.haulmont.cuba.gui.screen.compatibility.ScreenEditorWrapper)

Example 3 with ScreenEditorWrapper

use of com.haulmont.cuba.gui.screen.compatibility.ScreenEditorWrapper in project jmix by jmix-framework.

the class CubaScreens method openEditor.

@Override
public com.haulmont.cuba.gui.components.Window.Editor openEditor(WindowInfo windowInfo, Entity item, OpenType openType, Datasource parentDs) {
    Map<String, Object> params = createParametersMap(windowInfo, Collections.singletonMap(WindowParams.ITEM.name(), item));
    MapScreenOptions options = new MapScreenOptions(params);
    Screen screen = createScreen(windowInfo, openType.getOpenMode(), options);
    applyOpenTypeParameters(screen.getWindow(), openType);
    EditorScreen editorScreen = (EditorScreen) screen;
    if (editorScreen instanceof AbstractEditor) {
        ((AbstractEditor) editorScreen).setParentDs(parentDs);
    }
    editorScreen.setEntityToEdit(item);
    show(screen);
    return screen instanceof com.haulmont.cuba.gui.components.Window.Editor ? (com.haulmont.cuba.gui.components.Window.Editor) screen : new ScreenEditorWrapper(screen);
}
Also used : EditorScreen(io.jmix.ui.screen.EditorScreen) LookupScreen(io.jmix.ui.screen.LookupScreen) EditorScreen(io.jmix.ui.screen.EditorScreen) Screen(io.jmix.ui.screen.Screen) MapScreenOptions(io.jmix.ui.screen.MapScreenOptions) AbstractEditor(com.haulmont.cuba.gui.components.AbstractEditor) ScreenEditorWrapper(com.haulmont.cuba.gui.screen.compatibility.ScreenEditorWrapper)

Example 4 with ScreenEditorWrapper

use of com.haulmont.cuba.gui.screen.compatibility.ScreenEditorWrapper in project jmix by jmix-framework.

the class CubaScreens method openEditor.

@Override
public com.haulmont.cuba.gui.components.Window.Editor openEditor(WindowInfo windowInfo, Entity item, OpenType openType, @Nullable Map<String, Object> params, Datasource parentDs) {
    params = createParametersMap(windowInfo, params);
    params.put(WindowParams.ITEM.name(), item);
    MapScreenOptions options = new MapScreenOptions(params);
    Screen screen = createScreen(windowInfo, openType.getOpenMode(), options);
    applyOpenTypeParameters(screen.getWindow(), openType);
    EditorScreen editorScreen = (EditorScreen) screen;
    if (editorScreen instanceof AbstractEditor) {
        ((AbstractEditor) editorScreen).setParentDs(parentDs);
    }
    editorScreen.setEntityToEdit(item);
    show(screen);
    return screen instanceof com.haulmont.cuba.gui.components.Window.Editor ? (com.haulmont.cuba.gui.components.Window.Editor) screen : new ScreenEditorWrapper(screen);
}
Also used : EditorScreen(io.jmix.ui.screen.EditorScreen) LookupScreen(io.jmix.ui.screen.LookupScreen) EditorScreen(io.jmix.ui.screen.EditorScreen) Screen(io.jmix.ui.screen.Screen) MapScreenOptions(io.jmix.ui.screen.MapScreenOptions) AbstractEditor(com.haulmont.cuba.gui.components.AbstractEditor) ScreenEditorWrapper(com.haulmont.cuba.gui.screen.compatibility.ScreenEditorWrapper)

Aggregations

ScreenEditorWrapper (com.haulmont.cuba.gui.screen.compatibility.ScreenEditorWrapper)4 EditorScreen (io.jmix.ui.screen.EditorScreen)4 LookupScreen (io.jmix.ui.screen.LookupScreen)4 Screen (io.jmix.ui.screen.Screen)4 MapScreenOptions (io.jmix.ui.screen.MapScreenOptions)3 AbstractEditor (com.haulmont.cuba.gui.components.AbstractEditor)2