Search in sources :

Example 16 with MapScreenOptions

use of io.jmix.ui.screen.MapScreenOptions in project jmix by jmix-framework.

the class EditorBuilderProcessor method getOptionsForScreen.

@Override
protected <E> ScreenOptions getOptionsForScreen(String editorScreenId, E entity, EditorBuilder<E> builder) {
    ScreenOptions options = super.getOptionsForScreen(editorScreenId, entity, builder);
    WindowInfo windowInfo = windowConfig.getWindowInfo(editorScreenId);
    if (LegacyFrame.class.isAssignableFrom(windowInfo.getControllerClass()) && options == FrameOwner.NO_OPTIONS) {
        HashMap<String, Object> paramsMap = new HashMap<>();
        paramsMap.put(WindowParams.ITEM.name(), entity);
        options = new MapScreenOptions(paramsMap);
    }
    return options;
}
Also used : HashMap(java.util.HashMap) LegacyFrame(com.haulmont.cuba.gui.screen.compatibility.LegacyFrame) MapScreenOptions(io.jmix.ui.screen.MapScreenOptions) ScreenOptions(io.jmix.ui.screen.ScreenOptions) MapScreenOptions(io.jmix.ui.screen.MapScreenOptions) WindowInfo(io.jmix.ui.WindowInfo)

Example 17 with MapScreenOptions

use of io.jmix.ui.screen.MapScreenOptions in project jmix by jmix-framework.

the class ResetPasswordAction method buildAndShowResetPasswordDialog.

private void buildAndShowResetPasswordDialog() {
    MapScreenOptions options = new MapScreenOptions(ParamsMap.of("users", target.getSelected()));
    screenBuilders.screen(target.getFrame().getFrameOwner()).withScreenClass(ResetPasswordDialog.class).withOpenMode(OpenMode.DIALOG).withOptions(options).build().show();
}
Also used : MapScreenOptions(io.jmix.ui.screen.MapScreenOptions)

Example 18 with MapScreenOptions

use of io.jmix.ui.screen.MapScreenOptions in project jmix by jmix-framework.

the class PivotScreenBuilder method build.

/**
 * @return created screen
 */
public Screen build() {
    Frame frame = target.getFrame();
    if (frame == null) {
        throw new IllegalStateException(String.format("ShowPivotManager cannot be used by component '%s' which is not added to frame", target.getId()));
    }
    FrameOwner origin = frame.getFrameOwner();
    Screens screens = getScreenContext(origin).getScreens();
    if (dataItems == null) {
        dataItems = Collections.emptyList();
    }
    Map<String, String> properties = getPropertiesWithLocale();
    MapScreenOptions options = new MapScreenOptions(ParamsMap.of("dataItems", dataItems, "properties", properties, "nativeJson", nativeJson));
    return screens.create(SCREEN_ID, OpenMode.NEW_TAB, options);
}
Also used : Frame(io.jmix.ui.component.Frame) FrameOwner(io.jmix.ui.screen.FrameOwner) MapScreenOptions(io.jmix.ui.screen.MapScreenOptions) Screens(io.jmix.ui.Screens)

Example 19 with MapScreenOptions

use of io.jmix.ui.screen.MapScreenOptions in project jmix by jmix-framework.

the class DataGridEditorComponentGenerationStrategy method initActionScreenParameters.

private void initActionScreenParameters(@Nullable Action.ScreenOpeningAction action) {
    if (action != null) {
        // Opening screen in another mode will close editor
        action.setOpenMode(OpenMode.DIALOG);
        // In case of adding special logic for a screen opened from DataGrid editor
        action.setScreenOptionsSupplier(() -> new MapScreenOptions(ParamsMap.of("dataGridEditor", true)));
    }
}
Also used : MapScreenOptions(io.jmix.ui.screen.MapScreenOptions)

Example 20 with MapScreenOptions

use of io.jmix.ui.screen.MapScreenOptions in project jmix by jmix-framework.

the class RootNavigationHandler method handle404.

protected void handle404(String route, AppUI ui) {
    RootWindow topWindow = ui.getTopLevelWindow();
    Screen rootScreen = topWindow != null ? topWindow.getFrameOwner() : null;
    if (rootScreen instanceof Window.HasWorkArea) {
        MapScreenOptions options = new MapScreenOptions(ParamsMap.of("requestedRoute", route));
        ui.getScreens().create(NotFoundScreen.class, OpenMode.NEW_TAB, options).show();
    } else {
        ui.getNotifications().create(Notifications.NotificationType.TRAY).withCaption(messages.formatMessage("", "navigation.screenNotFound", route)).show();
    }
}
Also used : Screen(io.jmix.ui.screen.Screen) NotFoundScreen(io.jmix.ui.app.navigation.notfoundwindow.NotFoundScreen) RootWindow(io.jmix.ui.component.RootWindow) MapScreenOptions(io.jmix.ui.screen.MapScreenOptions) NotFoundScreen(io.jmix.ui.app.navigation.notfoundwindow.NotFoundScreen)

Aggregations

MapScreenOptions (io.jmix.ui.screen.MapScreenOptions)20 Screen (io.jmix.ui.screen.Screen)11 EditorScreen (io.jmix.ui.screen.EditorScreen)9 LookupScreen (io.jmix.ui.screen.LookupScreen)8 MetaClass (io.jmix.core.metamodel.model.MetaClass)4 HashMap (java.util.HashMap)4 LegacyFrame (com.haulmont.cuba.gui.screen.compatibility.LegacyFrame)3 ScreenEditorWrapper (com.haulmont.cuba.gui.screen.compatibility.ScreenEditorWrapper)3 AbstractEditor (com.haulmont.cuba.gui.components.AbstractEditor)2 SelectHandlerAdapter (com.haulmont.cuba.gui.components.compatibility.SelectHandlerAdapter)2 ScreenLookupWrapper (com.haulmont.cuba.gui.screen.compatibility.ScreenLookupWrapper)2 ScreenWrapper (com.haulmont.cuba.gui.screen.compatibility.ScreenWrapper)2 Screens (io.jmix.ui.Screens)2 ScreenFragment (io.jmix.ui.screen.ScreenFragment)2 EntityLoadInfo (com.haulmont.cuba.core.global.EntityLoadInfo)1 WindowManager (com.haulmont.cuba.gui.WindowManager)1 OpenType (com.haulmont.cuba.gui.WindowManager.OpenType)1 Filter (com.haulmont.cuba.gui.components.Filter)1 LegacyFragmentAdapter (com.haulmont.cuba.gui.components.compatibility.LegacyFragmentAdapter)1 DsContextImplementation (com.haulmont.cuba.gui.data.impl.DsContextImplementation)1