use of io.jmix.ui.Screens in project jmix by jmix-framework.
the class LocalizedTaskWrapper method done.
@Override
public void done(V result) {
Screens screens = getScreenContext().getScreens();
screens.remove(screen);
try {
wrappedTask.done(result);
} catch (Exception ex) {
// we should show exception messages immediately
showExecutionError(ex);
}
}
use of io.jmix.ui.Screens in project jmix by jmix-framework.
the class CubaScreensEventListener method saveScreenSettings.
public void saveScreenSettings(Screens screens) {
Screens.OpenedScreens openedScreens = screens.getOpenedScreens();
Screen rootScreen = openedScreens.getRootScreen();
if (rootScreen instanceof CubaLegacySettings) {
((CubaLegacySettings) rootScreen).saveSettings();
}
for (Screen screen : openedScreens.getWorkAreaScreens()) {
if (screen instanceof CubaLegacySettings) {
((CubaLegacySettings) screen).saveSettings();
}
}
for (Screen screen : openedScreens.getDialogScreens()) {
if (screen instanceof CubaLegacySettings) {
((CubaLegacySettings) screen).saveSettings();
}
}
}
use of io.jmix.ui.Screens in project jmix by jmix-framework.
the class EditorScreenShowEntityInfoAction method execute.
@Override
public void execute(Screen screen) {
if (!(screen instanceof EditorScreen)) {
throw new IllegalArgumentException("Screen must be instance of EditorScreen");
}
Object entity = ((EditorScreen<?>) screen).getEditedEntity();
Screens screens = UiControllerUtils.getScreenContext(screen).getScreens();
EntityInfoWindow infoWindow = screens.create(EntityInfoWindow.class);
infoWindow.setEntity(entity);
infoWindow.show();
}
use of io.jmix.ui.Screens in project jmix by jmix-framework.
the class ShowEntityInfoAction method showInfo.
public void showInfo(Object entity, Component.BelongToFrame component) {
Screens screens = ComponentsHelper.getScreenContext(component).getScreens();
EntityInfoWindow screen = screens.create(EntityInfoWindow.class);
screen.setEntity(entity);
screen.show();
}
use of io.jmix.ui.Screens in project jmix by jmix-framework.
the class BackgroundWorkWindow method show.
/**
* Show modal window with message which will last until task completes.
* Optionally cancel button can be displayed. By pressing cancel button user can cancel task execution.
*
* @param task background task containing long operation
* @param title window title, optional
* @param message window message, optional
* @param cancelAllowed show or not cancel button
* @param <T> task progress unit
* @param <V> task result type
*/
public static <T, V> void show(BackgroundTask<T, V> task, @Nullable String title, @Nullable String message, boolean cancelAllowed) {
if (task.getOwnerScreen() == null) {
throw new IllegalArgumentException("Task without owner cannot be run");
}
Map<String, Object> params = new HashMap<>();
params.put("task", task);
params.put("title", title);
params.put("message", message);
params.put("cancelAllowed", cancelAllowed);
Screens screens = UiControllerUtils.getScreenContext(task.getOwnerScreen()).getScreens();
WindowInfo windowInfo = AppBeans.get(WindowConfig.class).getWindowInfo("backgroundWorkWindow");
((WindowManager) screens).openWindow(windowInfo, OpenType.DIALOG, params);
}
Aggregations