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