use of com.haulmont.cuba.gui.config.WindowInfo in project cuba by cuba-platform.
the class WebRelatedEntities method addNavigationAction.
protected void addNavigationAction(MetaClass metaClass, MetaProperty metaProperty) {
// check if browse screen available
PropertyOption propertyOption = propertyOptions.get(metaProperty.getName());
WindowInfo defaultScreen = screensHelper.getDefaultBrowseScreen(metaProperty.getRange().asClass());
if (defaultScreen != null || (propertyOption != null && StringUtils.isNotEmpty(propertyOption.getScreen()))) {
RelatedAction relatedAction = RelatedAction.create("related" + actionOrder.size(), listComponent, metaClass, metaProperty);
relatedAction.setOpenType(openType);
if (defaultScreen != null) {
relatedAction.setScreen(defaultScreen.getId());
}
if (propertyOption != null) {
if (StringUtils.isNotEmpty(propertyOption.getCaption())) {
relatedAction.setCaption(propertyOption.getCaption());
}
if (StringUtils.isNotEmpty(propertyOption.getFilterCaption())) {
relatedAction.setFilterCaption(propertyOption.getFilterCaption());
}
if (StringUtils.isNotEmpty(propertyOption.getScreen())) {
relatedAction.setScreen(propertyOption.getScreen());
}
}
addAction(relatedAction);
}
}
use of com.haulmont.cuba.gui.config.WindowInfo in project cuba by cuba-platform.
the class MainTabSheetActionHandler method analyzeLayout.
protected void analyzeLayout(Object target) {
Window window = findWindow((Layout) target);
if (window != null) {
LayoutAnalyzer analyzer = new LayoutAnalyzer();
List<LayoutTip> tipsList = analyzer.analyze(window);
if (tipsList.isEmpty()) {
Notifications notifications = ComponentsHelper.getScreenContext(window).getNotifications();
notifications.create(NotificationType.HUMANIZED).withCaption("No layout problems found").show();
} else {
WindowManager wm = (WindowManager) ComponentsHelper.getScreenContext(window).getScreens();
WindowInfo windowInfo = AppBeans.get(WindowConfig.class).getWindowInfo("layoutAnalyzer");
wm.openWindow(windowInfo, WindowManager.OpenType.DIALOG, ParamsMap.of("tipsList", tipsList));
}
}
}
use of com.haulmont.cuba.gui.config.WindowInfo in project cuba by cuba-platform.
the class WebFragments method create.
@Override
public ScreenFragment create(FrameOwner parent, String screenFragmentId, ScreenOptions options) {
checkNotNullArgument(parent);
checkNotNullArgument(screenFragmentId);
checkNotNullArgument(options);
WindowInfo windowInfo = windowConfig.getWindowInfo(screenFragmentId).resolve();
return createFragment(parent, windowInfo, options);
}
use of com.haulmont.cuba.gui.config.WindowInfo in project cuba by cuba-platform.
the class WebScreens method create.
@Override
public <T extends Screen> T create(Class<T> requiredScreenClass, LaunchMode launchMode, ScreenOptions options) {
checkNotNullArgument(requiredScreenClass);
checkNotNullArgument(launchMode);
checkNotNullArgument(options);
WindowInfo windowInfo = getScreenInfo(requiredScreenClass).resolve();
return createScreen(windowInfo, launchMode, options);
}
Aggregations