use of com.haulmont.cuba.gui.config.WindowInfo in project cuba by cuba-platform.
the class WebFrame method openFrame.
@Override
public Frame openFrame(Component parent, String windowAlias) {
WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
WindowInfo windowInfo = windowConfig.getWindowInfo(windowAlias);
WebWindowManager wm = App.getInstance().getWindowManager();
Frame wrappedFrame = ((Frame.Wrapper) wrapper).getWrappedFrame();
return wm.openFrame(wrappedFrame, parent, windowInfo);
}
use of com.haulmont.cuba.gui.config.WindowInfo in project cuba by cuba-platform.
the class WebFrame method openEditor.
@Override
public Window.Editor openEditor(Entity item, WindowManager.OpenType openType, Map<String, Object> params, Datasource parentDs) {
WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
WindowInfo editorScreen = windowConfig.getEditorScreen(item);
WebWindowManager wm = App.getInstance().getWindowManager();
return wm.openEditor(editorScreen, item, openType, params, parentDs);
}
use of com.haulmont.cuba.gui.config.WindowInfo in project cuba by cuba-platform.
the class FrameComponentLoader method createComponent.
@Override
public void createComponent() {
String src = element.attributeValue("src");
String screenId = element.attributeValue("screen");
if (src == null && screenId == null) {
throw new GuiDevelopmentException("Either 'src' or 'screen' must be specified for 'frame'", context.getFullFrameId());
}
if (src == null) {
WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
WindowInfo windowInfo = windowConfig.getWindowInfo(screenId);
src = windowInfo.getTemplate();
if (src == null) {
throw new GuiDevelopmentException("Screen " + screenId + " doesn't have template path configured", context.getFullFrameId());
}
}
if (element.attributeValue("id") != null) {
frameId = element.attributeValue("id");
}
LayoutLoader layoutLoader = new LayoutLoader(context, factory, LayoutLoaderConfig.getFrameLoaders());
layoutLoader.setLocale(getLocale());
layoutLoader.setMessagesPack(getMessagesPack());
String currentFrameId = context.getCurrentFrameId();
context.setCurrentFrameId(frameId);
try {
Pair<ComponentLoader, Element> loaderElementPair = layoutLoader.createFrameComponent(src, frameId, context.getParams());
frameLoader = loaderElementPair.getFirst();
resultComponent = (Frame) frameLoader.getResultComponent();
} finally {
context.setCurrentFrameId(currentFrameId);
}
}
Aggregations