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


Java ComponentsHelper.getWindowImplementation方法代码示例

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


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

示例1: setupUpdateTimer

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected void setupUpdateTimer() {
    int period = webConfig.getAppFoldersRefreshPeriodSec() * 1000;

    timer = new FoldersPaneTimer();
    timer.setRepeating(true);
    timer.setDelay(period);
    timer.addActionListener(createAppFolderUpdater());
    timer.start();

    if (this.isAttached()) {
        AppUI ui = AppUI.getCurrent();
        stopExistingFoldersPaneTimer(ui);
        ui.addTimer(timer);
    } else if (frame != null) {
        com.haulmont.cuba.gui.components.Window window = ComponentsHelper.getWindowImplementation(frame);
        if (window == null) {
            throw new IllegalStateException("Null window for CubaFoldersPane");
        }
        AbstractComponent topLevelFrame = window.unwrapComposition(AbstractComponent.class);
        timer.extend(topLevelFrame);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:23,代码来源:CubaFoldersPane.java

示例2: build

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
public void build(AppMenu appMenu) {
    this.appMenu = appMenu;

    Window window = ComponentsHelper.getWindowImplementation(appMenu);
    if (window == null) {
        throw new IllegalStateException("AppMenu is not belong to Window");
    }

    List<MenuItem> rootItems = menuConfig.getRootItems();
    for (MenuItem menuItem : rootItems) {
        if (menuItem.isPermitted(session)) {
            createMenuBarItem(window, menuItem);
        }
    }
    removeExtraSeparators();
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:17,代码来源:MenuBuilder.java

示例3: detachCloseListener

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
private void detachCloseListener() {
    // force remove close listener
    Frame ownerFrame = getTask().getOwnerFrame();
    if (ownerFrame != null) {
        Window ownerWindow = ComponentsHelper.getWindowImplementation(ownerFrame);
        if (ownerWindow != null) {
            ownerWindow.removeCloseListener(closeListener);

            String windowClass = ownerFrame.getClass().getCanonicalName();
            log.trace("Resources were disposed. Task: {}. Frame: {}", taskExecutor.getTask(), windowClass);
        } else {
            log.trace("Empty ownerWindow. Resources were not disposed. Task: {}", taskExecutor.getTask());
        }
    } else {
        log.trace("Empty ownerFrame. Resources were not disposed. Task: {}", taskExecutor.getTask());
    }
    closeListener = null;
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:19,代码来源:TaskHandlerImpl.java

示例4: isCloseWithShortcutPrevented

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected boolean isCloseWithShortcutPrevented(Window currentWindow) {
    WebWindow webWindow = (WebWindow) ComponentsHelper.getWindowImplementation(currentWindow);

    if (webWindow != null) {
        BeforeCloseWithShortcutEvent event = new BeforeCloseWithShortcutEvent(webWindow);
        webWindow.fireBeforeCloseWithShortcut(event);
        return event.isClosePrevented();
    }

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

示例5: isCloseWithCloseButtonPrevented

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected boolean isCloseWithCloseButtonPrevented(Window currentWindow) {
    WebWindow webWindow = (WebWindow) ComponentsHelper.getWindowImplementation(currentWindow);

    if (webWindow != null) {
        BeforeCloseWithCloseButtonEvent event = new BeforeCloseWithCloseButtonEvent(webWindow);
        webWindow.fireBeforeCloseWithCloseButton(event);
        return event.isClosePrevented();
    }

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

示例6: isCloseWithCloseButtonPrevented

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected boolean isCloseWithCloseButtonPrevented(Window currentWindow) {
    WebWindow webWindow = (WebWindow) ComponentsHelper.getWindowImplementation(currentWindow);

    if (webWindow != null) {
        Window.BeforeCloseWithCloseButtonEvent event = new Window.BeforeCloseWithCloseButtonEvent(webWindow);
        webWindow.fireBeforeCloseWithCloseButton(event);
        return event.isClosePrevented();
    }

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

示例7: build

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
public void build(SideMenu menu) {
    Window window = ComponentsHelper.getWindowImplementation(menu);

    if (window == null) {
        throw new IllegalStateException("SideMenu is not belong to Window");
    }

    List<MenuItem> rootItems = menuConfig.getRootItems();
    for (MenuItem menuItem : rootItems) {
        if (menuItem.isPermitted(session)) {
            createMenuBarItem(window, menu, menuItem);
        }
    }
    removeExtraSeparators(menu);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:16,代码来源:SideMenuBuilder.java

示例8: 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()) {
        Window window = ComponentsHelper.getWindowImplementation(WebAbstractTable.this);
        if (window instanceof Window.Wrapper) {
            window = ((Window.Wrapper) window).getWrappedWindow();
        }

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

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

示例9: createColumns

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected Collection<MetaPropertyPath> createColumns(com.vaadin.data.Container ds) {
    @SuppressWarnings("unchecked")
    final Collection<MetaPropertyPath> properties = (Collection<MetaPropertyPath>) ds.getContainerPropertyIds();

    Window window = ComponentsHelper.getWindowImplementation(this);
    boolean isLookup = window instanceof Window.Lookup;

    for (MetaPropertyPath propertyPath : properties) {
        final Table.Column column = columns.get(propertyPath);
        if (column != null && !(editable && BooleanUtils.isTrue(column.isEditable()))) {
            final String isLink =
                    column.getXmlDescriptor() == null ?
                            null : column.getXmlDescriptor().attributeValue("link");

            if (propertyPath.getRange().isClass()) {
                if (!isLookup && StringUtils.isNotEmpty(isLink)) {
                    setClickListener(propertyPath.toString(), new LinkCellClickListener());
                }
            } else if (propertyPath.getRange().isDatatype()) {
                if (!isLookup && !StringUtils.isEmpty(isLink)) {
                    setClickListener(propertyPath.toString(), new LinkCellClickListener());
                } else if (editable && BooleanUtils.isTrue(column.isCalculatable())) {
                    addGeneratedColumn(propertyPath, new CalculatableColumnGenerator());
                } else {
                    if (column.getMaxTextLength() != null) {
                        addGeneratedColumn(propertyPath, new AbbreviatedColumnGenerator(column));
                        setClickListener(propertyPath.toString(), new AbbreviatedCellClickListener());
                    }
                }
            } else if (!propertyPath.getRange().isEnum()) {
                throw new UnsupportedOperationException();
            }
        }
    }

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

示例10: handleDoubleClickAction

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected void handleDoubleClickAction() {
    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()) {
        Window window = ComponentsHelper.getWindowImplementation(WebDataGrid.this);
        if (window instanceof Window.Wrapper) {
            window = ((Window.Wrapper) window).getWrappedWindow();
        }

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

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

示例11: handleClickAction

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected void handleClickAction() {
    Action action = getItemClickAction();
    if (action == null) {
        action = getEnterPressAction();
        if (action == null) {
            action = getAction("edit");
            if (action == null) {
                action = getAction("view");
            }
        }
    }

    if (action != null && action.isEnabled()) {
        Window window = ComponentsHelper.getWindowImplementation(WebAbstractTree.this);
        if (window instanceof Window.Wrapper) {
            window = ((Window.Wrapper) window).getWrappedWindow();
        }

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

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

示例12: handleClickAction

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected void handleClickAction() {
    Action action = getItemClickAction();
    if (action == null) {
        action = getEnterPressAction();
        if (action == null) {
            action = getAction("edit");
            if (action == null) {
                action = getAction("view");
            }
        }
    }

    if (action != null && action.isEnabled()) {
        Window window = ComponentsHelper.getWindowImplementation(DesktopTree.this);
        if (window instanceof Window.Wrapper) {
            window = ((Window.Wrapper) window).getWrappedWindow();
        }

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

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

示例13: loadButtonsPanel

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected void loadButtonsPanel(Tree component) {
    if (buttonsPanelLoader != null) {
        //noinspection unchecked
        buttonsPanelLoader.loadComponent();
        ButtonsPanel panel = (ButtonsPanel) buttonsPanelLoader.getResultComponent();

        Window window = ComponentsHelper.getWindowImplementation(component);
        String alwaysVisible = buttonsPanelElement.attributeValue("alwaysVisible");
        panel.setVisible(!(window instanceof Window.Lookup) || "true".equals(alwaysVisible));
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:12,代码来源:TreeLoader.java

示例14: loadButtonsPanel

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected void loadButtonsPanel(DataGrid component) {
    if (buttonsPanelLoader != null) {
        //noinspection unchecked
        buttonsPanelLoader.loadComponent();
        ButtonsPanel panel = (ButtonsPanel) buttonsPanelLoader.getResultComponent();

        Window window = ComponentsHelper.getWindowImplementation(component);
        String alwaysVisible = panelElement.attributeValue("alwaysVisible");
        panel.setVisible(!(window instanceof Window.Lookup) || "true".equals(alwaysVisible));
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:12,代码来源:DataGridLoader.java

示例15: loadButtonsPanel

import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected void loadButtonsPanel(T component) {
    if (buttonsPanelLoader != null) {
        //noinspection unchecked
        buttonsPanelLoader.loadComponent();
        ButtonsPanel panel = (ButtonsPanel) buttonsPanelLoader.getResultComponent();

        Window window = ComponentsHelper.getWindowImplementation(component);
        String alwaysVisible = panelElement.attributeValue("alwaysVisible");
        panel.setVisible(!(window instanceof Window.Lookup) || "true".equals(alwaysVisible));
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:12,代码来源:AbstractTableLoader.java


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