当前位置: 首页>>代码示例>>Java>>正文


Java ComponentsHelper.getWindow方法代码示例

本文整理汇总了Java中com.haulmont.cuba.gui.ComponentsHelper.getWindow方法的典型用法代码示例。如果您正苦于以下问题:Java ComponentsHelper.getWindow方法的具体用法?Java ComponentsHelper.getWindow怎么用?Java ComponentsHelper.getWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.haulmont.cuba.gui.ComponentsHelper的用法示例。


在下文中一共展示了ComponentsHelper.getWindow方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: stateChanged

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
@Override
public void stateChanged(ChangeEvent e) {
    if (context != null) {
        context.executeInjectTasks();
        context.executePostWrapTasks();
        context.executeInitTasks();
    }

    // Fire GUI listener
    fireTabChanged();

    // Execute outstanding post init tasks after GUI listener.
    // We suppose that context.executePostInitTasks() executes a task once and then remove it from task list.
    if (context != null) {
        context.executePostInitTasks();
    }

    Window window = ComponentsHelper.getWindow(DesktopTabSheet.this);
    if (window != null) {
        ((DsContextImplementation) window.getDsContext()).resumeSuspended();
    } else {
        log.warn("Please specify Frame for TabSheet");
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:25,代码来源:DesktopTabSheet.java

示例2: updateWindowCaption

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected void updateWindowCaption() {
    Window window = ComponentsHelper.getWindow(filter);
    String filterTitle;
    if (filterMode == FilterMode.GENERIC_MODE && filterEntity != null && filterEntity != adHocFilter) {
        filterTitle = getFilterCaption(filterEntity);
    } else {
        filterTitle = null;
    }
    window.setDescription(filterTitle);

    if (initialWindowCaption == null) {
        initialWindowCaption = window.getCaption();
    }

    windowManager.setWindowCaption(window, initialWindowCaption, filterTitle);

    groupBoxLayout.setCaption(Strings.isNullOrEmpty(filterTitle) ? caption : caption + ": " + filterTitle);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:19,代码来源:FilterDelegateImpl.java

示例3: actionPerform

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
@Override
public void actionPerform(Component component) {
    if (filterEntity == null) {
        // todo add notification 'Filter not selected'
        return;
    }
    Set selected = target.getSelected();
    if (selected.isEmpty()) {
        return;
    }

    if (target.getDatasource().getItemIds().size() == 1) {
        filterHelper.removeFolderFromFoldersPane(filterEntity.getFolder());
        removeFilterEntity();

        Window window = ComponentsHelper.getWindow(filter);
        windowManager.close(window);
    } else {
        String filterXml = filterEntity.getXml();
        filterEntity.setXml(UserSetHelper.removeEntities(filterXml, selected));
        filterEntity.getFolder().setFilterXml(filterEntity.getXml());
        filterEntity.setFolder(saveFolder((filterEntity.getFolder())));
        setFilterEntity(filterEntity);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:26,代码来源:FilterDelegateImpl.java

示例4: handleValidationErrors

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected boolean handleValidationErrors(ValidationErrors errors) {
    if (errors.isEmpty())
        return true;

    Window window = ComponentsHelper.getWindow(wrapper);
    if (window instanceof AbstractFrame) {
        ((AbstractFrame) window).showValidationErrors(errors);
    }

    WebComponentsHelper.focusProblemComponent(errors);

    return false;
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:14,代码来源:WebFrame.java

示例5: handleClickAction

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected void handleClickAction() {
    Action action = getItemClickAction();
    if (action == null) {
        action = getEnterAction();
        if (action == null) {
            action = getAction("edit");
            if (action == null) {
                action = getAction("view");
            }
        }
    }
    if (action != null && action.isEnabled() && action.isVisible()) {
        Window window = ComponentsHelper.getWindow(DesktopAbstractTable.this);
        if (window instanceof Window.Wrapper) {
            window = ((Window.Wrapper) window).getWrappedWindow();
        }

        if (!(window instanceof Window.Lookup)) {
            action.actionPerform(DesktopAbstractTable.this);
        } else {
            Window.Lookup lookup = (Window.Lookup) window;

            com.haulmont.cuba.gui.components.Component lookupComponent = lookup.getLookupComponent();
            if (lookupComponent != this) {
                action.actionPerform(DesktopAbstractTable.this);
            } else if (action.getId().equals(WindowDelegate.LOOKUP_ITEM_CLICK_ACTION_ID)) {
                action.actionPerform(DesktopAbstractTable.this);
            }
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:32,代码来源:DesktopAbstractTable.java

示例6: handleValidationErrors

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected boolean handleValidationErrors(ValidationErrors errors) {
    if (errors.isEmpty())
        return true;

    DesktopComponentsHelper.focusProblemComponent(errors);

    Window window = ComponentsHelper.getWindow(wrapper);
    if (window instanceof AbstractFrame) {
        SwingUtilities.invokeLater(() -> {
            ((AbstractFrame) window).showValidationErrors(errors);
        });
    }

    return false;
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:16,代码来源:DesktopFrame.java

示例7: loadFiltersAndApplyDefault

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
/**
 * Loads filter entities, finds default filter and applies it if found
 */
@Override
public void loadFiltersAndApplyDefault() {
    initShortcutActions();
    initAdHocFilter();
    loadFilterEntities();
    FilterEntity defaultFilter = getDefaultFilter(filterEntities);
    initFilterSelectComponents();

    if (defaultFilter == null) {
        defaultFilter = adHocFilter;
    }

    try {
        setFilterEntity(defaultFilter);
    } catch (Exception e) {
        log.error("Exception on loading default filter '" + defaultFilter.getName() + "'", e);
        windowManager.showNotification(messages.formatMainMessage("filter.errorLoadingDefaultFilter", defaultFilter.getName()), Frame.NotificationType.ERROR);
        defaultFilter = adHocFilter;
        setFilterEntity(adHocFilter);
    }

    if (defaultFilter != adHocFilter && (filterMode == FilterMode.GENERIC_MODE)) {
        Window window = ComponentsHelper.getWindow(filter);
        if (!WindowParams.DISABLE_AUTO_REFRESH.getBool(window.getContext())) {
            if (getResultingManualApplyRequired()) {
                if (BooleanUtils.isTrue(defaultFilter.getApplyDefault())) {
                    apply(true);
                }
            } else
                apply(true);
            if (filterEntity != null) {
                window.setDescription(getFilterCaption(filterEntity));
            } else
                window.setDescription(null);
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:41,代码来源:FilterDelegateImpl.java

示例8: signOut

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
public void signOut() {
    Window window = ComponentsHelper.getWindow(this);
    if (window == null) {
        throw new IllegalStateException("Unable to find Frame for logout button");
    }

    window.saveSettings();

    final WebWindowManager wm = (WebWindowManager) window.getWindowManager();
    wm.checkModificationsAndCloseAll(() -> {
        Connection connection = wm.getApp().getConnection();
        connection.logout();
    });
}
 
开发者ID:cuba-platform,项目名称:sample-dashboard,代码行数:15,代码来源:ExtAppMainWindow.java

示例9: selectedTabChange

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
@Override
public void selectedTabChange(com.vaadin.ui.Accordion.SelectedTabChangeEvent event) {
    com.vaadin.ui.Component selectedTab = WebAccordion.this.component.getSelectedTab();
    com.vaadin.ui.Component tabComponent = tabContent.getComponent();
    if (selectedTab == tabComponent && getLazyTabs().remove(tabComponent)) {
        loader.createComponent();

        Component lazyContent = loader.getResultComponent();

        tabContent.add(lazyContent);
        com.vaadin.ui.Component impl = WebComponentsHelper.getComposition(lazyContent);
        impl.setSizeFull();

        lazyContent.setParent(WebAccordion.this);

        loader.loadComponent();

        Window window = ComponentsHelper.getWindow(WebAccordion.this);
        if (window != null) {
            walkComponents(tabContent, (settingsComponent, name) -> {
                if (settingsComponent.getId() != null
                        && settingsComponent instanceof HasSettings) {
                    Settings settings = window.getSettings();
                    if (settings != null) {
                        Element e = settings.get(name);
                        ((HasSettings) settingsComponent).applySettings(e);

                        if (component instanceof Component.HasPresentations
                                && e.attributeValue("presentation") != null) {
                            final String def = e.attributeValue("presentation");
                            if (!StringUtils.isEmpty(def)) {
                                UUID defaultId = UUID.fromString(def);
                                ((Component.HasPresentations) component).applyPresentationAsDefault(defaultId);
                            }
                        }
                    }
                }
            });

            // init debug ids after all
            AppUI appUI = AppUI.getCurrent();
            if (appUI.isTestMode()) {
                context.addPostInitTask((context1, window1) -> {
                    Window.TopLevelWindow appWindow = appUI.getTopLevelWindow();
                    ((WebWindowManager) appWindow.getWindowManager()).initDebugIds(window1);
                });
            }
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:51,代码来源:WebAccordion.java

示例10: selectedTabChange

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
@Override
public void selectedTabChange(com.vaadin.ui.TabSheet.SelectedTabChangeEvent event) {
    com.vaadin.ui.Component selectedTab = WebTabSheet.this.component.getSelectedTab();
    com.vaadin.ui.Component tabComponent = tabContent.unwrap(com.vaadin.ui.Component.class);
    if (selectedTab == tabComponent && getLazyTabs().remove(tabComponent)) {
        loader.createComponent();

        Component lazyContent = loader.getResultComponent();

        tabContent.add(lazyContent);
        com.vaadin.ui.Component impl = WebComponentsHelper.getComposition(lazyContent);
        impl.setSizeFull();

        lazyContent.setParent(WebTabSheet.this);

        loader.loadComponent();

        WebAbstractComponent contentComponent = (WebAbstractComponent) lazyContent;

        contentComponent.setIcon(null);
        contentComponent.setCaption(null);
        contentComponent.setDescription(null);

        Window window = ComponentsHelper.getWindow(WebTabSheet.this);
        if (window != null) {
            walkComponents(tabContent, (settingsComponent, name) -> {
                if (settingsComponent.getId() != null
                        && settingsComponent instanceof HasSettings) {
                    Settings settings = window.getSettings();
                    if (settings != null) {
                        Element e = settings.get(name);
                        ((HasSettings) settingsComponent).applySettings(e);

                        if (component instanceof Component.HasPresentations
                                && e.attributeValue("presentation") != null) {
                            final String def = e.attributeValue("presentation");
                            if (!StringUtils.isEmpty(def)) {
                                UUID defaultId = UUID.fromString(def);
                                ((Component.HasPresentations) component).applyPresentationAsDefault(defaultId);
                            }
                        }
                    }
                }
            });

            // init debug ids after all
            AppUI appUI = AppUI.getCurrent();
            if (appUI.isTestMode()) {
                context.addPostInitTask((localContext, localWindow) -> {
                    Window.TopLevelWindow appWindow = appUI.getTopLevelWindow();
                    ((WebWindowManager) appWindow.getWindowManager()).initDebugIds(localWindow);
                });
            }
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:57,代码来源:WebTabSheet.java

示例11: initLazyTab

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected void initLazyTab(JComponent tab) {
    LazyTabInfo lti = null;
    for (LazyTabInfo lazyTabInfo : lazyTabs) {
        if (lazyTabInfo.getTabComponent() == tab) {
            lti = lazyTabInfo;
            break;
        }
    }

    if (lti == null) { // already initialized
        return;
    }

    if (!lti.getTab().isEnabled()) {
        return;
    }

    lazyTabs.remove(lti);

    lti.loader.createComponent();

    Component lazyContent = lti.loader.getResultComponent();

    lazyContent.setWidth("100%");
    lti.tabContent.add(lazyContent);
    lti.tabContent.expand(lazyContent, "", "");
    lazyContent.setParent(this);

    lti.loader.loadComponent();

    if (lazyContent instanceof DesktopAbstractComponent && !isEnabledWithParent()) {
        ((DesktopAbstractComponent) lazyContent).setParentEnabled(false);
    }

    final Window window = ComponentsHelper.getWindow(DesktopTabSheet.this);
    if (window != null) {
        ComponentsHelper.walkComponents(
                lti.tabContent,
                (component, name) -> {
                    if (component instanceof HasSettings) {
                        Settings settings = window.getSettings();
                        if (settings != null) {
                            Element e = settings.get(name);
                            ((HasSettings) component).applySettings(e);
                        }
                    }
                }
        );

        lti.getTab().setLazyInitialized(true);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:53,代码来源:DesktopTabSheet.java

示例12: actionPerform

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
@Override
public void actionPerform(Component component) {
    if (pickerField.isEditable()) {
        String windowAlias = getLookupScreen();
        if (windowAlias == null) {
            final MetaClass metaClass = pickerField.getMetaClass();
            if (metaClass == null) {
                throw new DevelopmentException("Neither metaClass nor datasource/property is specified for the PickerField",
                        "action ID", getId());
            }
            windowAlias = windowConfig.getAvailableLookupScreenId(metaClass);
        }

        WindowManager wm;
        Window window = ComponentsHelper.getWindow(pickerField);
        if (window == null) {
            LoggerFactory.getLogger(PickerField.class).warn("Please specify Frame for PickerField");

            wm = AppBeans.get(WindowManagerProvider.class).get();
        } else {
            wm = window.getWindowManager();
        }

        OpenType openType = getLookupScreenOpenType();
        DialogParams dialogParams = getLookupScreenDialogParams();

        Map<String, Object> screenParams = prepareScreenParams();

        if (openType.getOpenMode() == OpenMode.DIALOG && dialogParams != null) {
            wm.getDialogParams().copyFrom(dialogParams);
        }

        Window lookupWindow = wm.openLookup(
                windowConfig.getWindowInfo(windowAlias),
                this::handleLookupWindowSelection,
                openType,
                screenParams
        );
        lookupWindow.addCloseListener(actionId -> {
            // if value is selected then options datasource is refreshed in select handler
            if (!Window.Lookup.SELECT_ACTION_ID.equals(actionId)
                    && pickerField instanceof LookupPickerField) {
                LookupPickerField lookupPickerField = (LookupPickerField) pickerField;

                CollectionDatasource optionsDatasource = lookupPickerField.getOptionsDatasource();
                if (optionsDatasource != null && lookupPickerField.isRefreshOptionsOnLookupClose()) {
                    optionsDatasource.refresh();
                }
            }

            // move focus to owner
            pickerField.requestFocus();

            afterCloseLookup(actionId);
            if (afterLookupCloseHandler != null) {
                afterLookupCloseHandler.onClose(lookupWindow, actionId);
            }
        });
        afterLookupWindowOpened(lookupWindow);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:62,代码来源:PickerField.java


注:本文中的com.haulmont.cuba.gui.ComponentsHelper.getWindow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。