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


Java Window.Wrapper方法代码示例

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


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

示例1: moveFocus

import com.haulmont.cuba.gui.components.Window; //导入方法依赖的package包/类
protected void moveFocus(TabSheetBehaviour tabSheet, String tabId) {
    //noinspection SuspiciousMethodCalls
    Window window = tabs.get(tabSheet.getTabComponent(tabId)).getCurrentWindow();

    if (window != null) {
        boolean focused = false;
        String focusComponentId = window.getFocusComponent();
        if (focusComponentId != null) {
            com.haulmont.cuba.gui.components.Component focusComponent = window.getComponent(focusComponentId);
            if (focusComponent != null && focusComponent.isEnabled() && focusComponent.isVisible()) {
                focusComponent.requestFocus();
                focused = true;
            }
        }

        if (!focused && window instanceof Window.Wrapper) {
            Window.Wrapper wrapper = (Window.Wrapper) window;
            focused = ((WebWindow) wrapper.getWrappedWindow()).findAndFocusChildComponent();
            if (!focused) {
                tabSheet.focus();
            }
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:25,代码来源:WebWindowManager.java

示例2: close

import com.haulmont.cuba.gui.components.Window; //导入方法依赖的package包/类
@Override
public void close(Window window) {
    if (window instanceof Window.Wrapper) {
        window = ((Window.Wrapper) window).getWrappedWindow();
    }

    WindowOpenInfo openInfo = windowOpenMode.get(window);
    if (openInfo == null) {
        log.warn("Problem closing window {}: WindowOpenMode not found", window);
        return;
    }
    disableSavingScreenHistory = false;
    closeWindow(window, openInfo);
    windowOpenMode.remove(window);
    removeFromWindowMap(openInfo.getWindow());
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:17,代码来源:WebWindowManager.java

示例3: setDropZone

import com.haulmont.cuba.gui.components.Window; //导入方法依赖的package包/类
@Override
public void setDropZone(DropZone dropZone) {
    super.setDropZone(dropZone);

    if (uploadButton instanceof CubaFileUpload) {
        if (dropZone == null) {
            ((CubaFileUpload) uploadButton).setDropZone(null);
        } else {
            com.haulmont.cuba.gui.components.Component target = dropZone.getTarget();
            if (target instanceof Window.Wrapper) {
                target = ((Window.Wrapper) target).getWrappedWindow();
            }

            Component vComponent = target.unwrapComposition(Component.class);
            ((CubaFileUpload) uploadButton).setDropZone(vComponent);
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:19,代码来源:WebFileUploadField.java

示例4: setDropZone

import com.haulmont.cuba.gui.components.Window; //导入方法依赖的package包/类
@Override
public void setDropZone(DropZone dropZone) {
    super.setDropZone(dropZone);

    if (component instanceof CubaFileUpload) {
        if (dropZone == null) {
            ((CubaFileUpload) component).setDropZone(null);
        } else {
            com.haulmont.cuba.gui.components.Component target = dropZone.getTarget();
            if (target instanceof Window.Wrapper) {
                target = ((Window.Wrapper) target).getWrappedWindow();
            }

            Component vComponent = target.unwrapComposition(Component.class);
            ((CubaFileUpload) this.component).setDropZone(vComponent);
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:19,代码来源:WebFileMultiUploadField.java

示例5: moveFocus

import com.haulmont.cuba.gui.components.Window; //导入方法依赖的package包/类
protected void moveFocus(java.awt.Component tab) {
    Window window = tabs.get(tab).getCurrentWindow();

    if (window != null) {
        String focusComponentId = window.getFocusComponent();

        boolean focused = false;
        if (focusComponentId != null) {
            com.haulmont.cuba.gui.components.Component focusComponent = window.getComponent(focusComponentId);
            if (focusComponent != null) {
                if (focusComponent.isEnabled() && focusComponent.isVisible()) {
                    focusComponent.requestFocus();
                    focused = true;
                }
            }
        }

        if (!focused && window instanceof Window.Wrapper) {
            Window.Wrapper wrapper = (Window.Wrapper) window;
            focused = ((DesktopWindow) wrapper.getWrappedWindow()).findAndFocusChildComponent();
            if (!focused) {
                tabsPane.requestFocus();
            }
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:27,代码来源:DesktopWindowManager.java

示例6: close

import com.haulmont.cuba.gui.components.Window; //导入方法依赖的package包/类
@Override
public void close(Window window) {
    if (window instanceof Window.Wrapper) {
        window = ((Window.Wrapper) window).getWrappedWindow();
    }

    final WindowOpenInfo openInfo = windowOpenMode.get(window);
    if (openInfo == null) {
        log.warn("Problem closing window " + window + " : WindowOpenMode not found");
        return;
    }
    disableSavingScreenHistory = false;
    closeWindow(window, openInfo);
    windowOpenMode.remove(window);
    windows.remove(openInfo.getWindow());
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:17,代码来源:DesktopWindowManager.java

示例7: handleClickAction

import com.haulmont.cuba.gui.components.Window; //导入方法依赖的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

示例8: handleDoubleClickAction

import com.haulmont.cuba.gui.components.Window; //导入方法依赖的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

示例9: setWindowCaption

import com.haulmont.cuba.gui.components.Window; //导入方法依赖的package包/类
@Override
public void setWindowCaption(Window window, String caption, String description) {
    Window desktopWindow = window;
    if (window instanceof Window.Wrapper) {
        desktopWindow = ((Window.Wrapper) window).getWrappedWindow();
    }
    window.setCaption(caption);

    String formattedCaption = formatTabDescription(caption, description);
    WindowOpenInfo openInfo = windowOpenMode.get(desktopWindow);

    if (openInfo != null) {
        OpenMode openMode = openInfo.getOpenMode();

        if (openMode != OpenMode.DIALOG) {
            if (tabsPane != null) {
                int selectedIndex = tabsPane.getSelectedIndex();
                if (selectedIndex != -1) {
                    setActiveWindowCaption(caption, description, selectedIndex);
                }
            } else if (!isMainWindowManager) {
                setTopLevelWindowCaption(formattedCaption);
            }
        } else {
            JDialog jDialog = (JDialog) openInfo.getData();
            if (jDialog != null) {
                jDialog.setTitle(formattedCaption);
            }
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:32,代码来源:DesktopWindowManager.java

示例10: addWindowData

import com.haulmont.cuba.gui.components.Window; //导入方法依赖的package包/类
public void addWindowData(Window window, Object windowData, OpenType openType) {
    WindowOpenInfo openInfo = new WindowOpenInfo(window, openType.getOpenMode());
    openInfo.setData(windowData);
    if (window instanceof Window.Wrapper) {
        Window wrappedWindow = ((Window.Wrapper) window).getWrappedWindow();
        windowOpenMode.put(wrappedWindow, openInfo);
    } else {
        windowOpenMode.put(window, openInfo);
    }

    addShortcuts(window, openType);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:13,代码来源:DesktopWindowManager.java

示例11: handleClickAction

import com.haulmont.cuba.gui.components.Window; //导入方法依赖的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

示例12: handleClickAction

import com.haulmont.cuba.gui.components.Window; //导入方法依赖的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: setWindowCaption

import com.haulmont.cuba.gui.components.Window; //导入方法依赖的package包/类
@Override
public void setWindowCaption(Window window, String caption, String description) {
    Window webWindow = window;
    if (window instanceof Window.Wrapper) {
        webWindow = ((Window.Wrapper) window).getWrappedWindow();
    }
    window.setCaption(caption);
    window.setDebugId(description);

    WindowOpenInfo openInfo = windowOpenMode.get(webWindow);
    String formattedCaption;

    if (openInfo != null
            && (openInfo.getOpenMode() == OpenMode.NEW_TAB
            || openInfo.getOpenMode() == OpenMode.NEW_WINDOW
            || openInfo.getOpenMode() == OpenMode.THIS_TAB)) {
        formattedCaption = formatTabCaption(caption, description);
    } else {
        formattedCaption = formatTabDescription(caption, description);
    }

    if (openInfo != null) {
        if (openInfo.getOpenMode() == OpenMode.DIALOG) {
            com.vaadin.ui.Window dialog = (com.vaadin.ui.Window) openInfo.getData();
            dialog.setCaption(formattedCaption);
        } else {
            if (getConfiguredWorkArea(createWorkAreaContext(window)).getMode() == Mode.SINGLE) {
                return;
            }

            Component tabContent = (Component) openInfo.getData();
            if (tabContent == null) {
                return;
            }

            TabSheetBehaviour tabSheet = getConfiguredWorkArea(createWorkAreaContext(window))
                    .getTabbedWindowContainer().getTabSheetBehaviour();
            String tabId = tabSheet.getTab(tabContent);
            if (tabId == null) {
                return;
            }

            tabSheet.setTabCaption(tabId, formattedCaption);

            String formattedDescription = formatTabDescription(caption, description);
            if (!Objects.equals(formattedDescription, formattedCaption)) {
                tabSheet.setTabDescription(tabId, formattedDescription);
            } else {
                tabSheet.setTabDescription(tabId, null);
            }
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:54,代码来源:WebWindowManager.java

示例14: showNewWindow

import com.haulmont.cuba.gui.components.Window; //导入方法依赖的package包/类
protected JComponent showNewWindow(Window window, OpenType openType, String caption) {
    window.setHeight("100%");
    window.setWidth("100%");

    TopLevelFrame windowFrame = createTopLevelFrame(caption);
    windowFrame.setName(window.getId());

    Dimension dimension = new Dimension();

    dimension.width = 800;
    if (openType.getWidth() != null) {
        dimension.width = openType.getWidth().intValue();
    }

    dimension.height = 500;
    if (openType.getHeight() != null) {
        dimension.height = openType.getHeight().intValue();
    }

    boolean resizable = true;
    if (openType.getResizable() != null) {
        resizable = openType.getResizable();
    }
    windowFrame.setResizable(resizable);
    windowFrame.setMinimumSize(dimension);
    windowFrame.pack();

    getDialogParams().reset();

    WindowBreadCrumbs breadCrumbs = createBreadCrumbs();
    breadCrumbs.addWindow(window);

    JComponent tabContent = createTabPanel(window, breadCrumbs);

    WindowOpenInfo openInfo = new WindowOpenInfo(window, OpenMode.NEW_WINDOW);
    openInfo.setData(tabContent);
    Map<Window, WindowOpenInfo> openInfos = new HashMap<>();
    if (window instanceof Window.Wrapper) {
        Window wrappedWindow = ((Window.Wrapper) window).getWrappedWindow();
        openInfos.put(wrappedWindow, openInfo);
    } else {
        openInfos.put(window, openInfo);
    }

    windowFrame.getWindowManager().attachTab(breadCrumbs,
            new Stack<>(),
            window,
            getWindowHashCode(window),
            tabContent, openInfos);

    App.getInstance().registerFrame(windowFrame);

    windowFrame.setVisible(true);
    return DesktopComponentsHelper.getComposition(window);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:56,代码来源:DesktopWindowManager.java


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