Search in sources :

Example 71 with WindowInfo

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);
    }
}
Also used : RelatedAction(com.haulmont.cuba.gui.components.actions.RelatedAction) WindowInfo(com.haulmont.cuba.gui.config.WindowInfo)

Example 72 with WindowInfo

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));
        }
    }
}
Also used : Window(com.haulmont.cuba.gui.components.Window) WindowConfig(com.haulmont.cuba.gui.config.WindowConfig) LayoutTip(com.haulmont.cuba.gui.app.core.dev.LayoutTip) LayoutAnalyzer(com.haulmont.cuba.gui.app.core.dev.LayoutAnalyzer) Notifications(com.haulmont.cuba.gui.Notifications) WindowManager(com.haulmont.cuba.gui.WindowManager) WindowInfo(com.haulmont.cuba.gui.config.WindowInfo)

Example 73 with WindowInfo

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);
}
Also used : WindowInfo(com.haulmont.cuba.gui.config.WindowInfo)

Example 74 with WindowInfo

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);
}
Also used : WindowInfo(com.haulmont.cuba.gui.config.WindowInfo)

Aggregations

WindowInfo (com.haulmont.cuba.gui.config.WindowInfo)74 WindowConfig (com.haulmont.cuba.gui.config.WindowConfig)43 WebWindowManager (com.haulmont.cuba.web.WebWindowManager)15 WindowManager (com.haulmont.cuba.gui.WindowManager)9 Element (org.dom4j.Element)8 Window (com.haulmont.cuba.gui.components.Window)7 LegacyFrame (com.haulmont.cuba.gui.screen.compatibility.LegacyFrame)5 HashMap (java.util.HashMap)5 Screens (com.haulmont.cuba.gui.Screens)3 FrameOwner (com.haulmont.cuba.gui.screen.FrameOwner)3 LayoutLoader (com.haulmont.cuba.gui.xml.layout.LayoutLoader)3 com.haulmont.cuba.core.global (com.haulmont.cuba.core.global)2 DetachedFrame (com.haulmont.cuba.desktop.DetachedFrame)2 GuiDevelopmentException (com.haulmont.cuba.gui.GuiDevelopmentException)2 Notifications (com.haulmont.cuba.gui.Notifications)2 OpenType (com.haulmont.cuba.gui.WindowManager.OpenType)2 Filter (com.haulmont.cuba.gui.components.Filter)2 Fragment (com.haulmont.cuba.gui.components.Fragment)2 RelatedAction (com.haulmont.cuba.gui.components.actions.RelatedAction)2 AddConditionWindow (com.haulmont.cuba.gui.components.filter.addcondition.AddConditionWindow)2