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