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


Java Window.Lookup方法代码示例

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


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

示例1: openLookup

import com.haulmont.cuba.gui.components.Window; //导入方法依赖的package包/类
@Override
public Window.Lookup openLookup(WindowInfo windowInfo, Window.Lookup.Handler handler, OpenType openType, Map<String, Object> params) {
    Window.Lookup window = super.openLookup(windowInfo, handler, openType, params);
    if (window != null) {
        screenProfiler.initProfilerMarkerForWindow(windowInfo.getId());
    }
    return window;
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:9,代码来源:WebWindowManager.java

示例2: 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

示例3: createColumns

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

示例4: 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

示例5: 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

示例6: 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

示例7: openLookup

import com.haulmont.cuba.gui.components.Window; //导入方法依赖的package包/类
@Override
public Window.Lookup openLookup(Class<? extends Entity>  entityClass, Window.Lookup.Handler handler, WindowManager.OpenType openType) {
    return delegate.openLookup(entityClass, handler, openType);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:5,代码来源:WebWindow.java

示例8: openLookup

import com.haulmont.cuba.gui.components.Window; //导入方法依赖的package包/类
@Override
public Window.Lookup openLookup(Class<? extends Entity> entityClass, Window.Lookup.Handler handler, WindowManager.OpenType openType) {
    return delegate.openLookup(entityClass, handler, openType);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:5,代码来源:DesktopWindow.java

示例9: openLookupWindow

import com.haulmont.cuba.gui.components.Window; //导入方法依赖的package包/类
private void openLookupWindow() {
    WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);

    String windowAlias;
    if (getLookupScreen() != null) {
        windowAlias = getLookupScreen();
    } else if (getOptionsDatasource() != null) {
        windowAlias = windowConfig.getBrowseScreenId(getOptionsDatasource().getMetaClass());
    } else {
        windowAlias = windowConfig.getBrowseScreenId(getDatasource().getMetaClass());
    }

    WindowInfo windowInfo = windowConfig.getWindowInfo(windowAlias);

    Map<String, Object> params = new HashMap<>();
    params.put("windowOpener", DesktopTokenList.this.getFrame().getId());
    if (isMultiSelect()) {
        WindowParams.MULTI_SELECT.set(params, true);
        // for backward compatibility
        params.put("multiSelect", "true");
    }
    if (lookupScreenParams != null) {
        params.putAll(lookupScreenParams);
    }

    WindowManager wm = DesktopComponentsHelper.getTopLevelFrame(DesktopTokenList.this).getWindowManager();
    if (lookupOpenMode == WindowManager.OpenType.DIALOG) {
        DialogParams dialogParams = wm.getDialogParams();

        dialogParams.setResizable(true);
        if (lookupScreenDialogParams != null) {
            dialogParams.setWidth(lookupScreenDialogParams.getWidth());
            dialogParams.setHeight(lookupScreenDialogParams.getHeight());
        } else {
            dialogParams.setWidth("800px");
            dialogParams.setHeight("600px");
        }
    }

    Window.Lookup lookupWindow = wm.openLookup(windowInfo, new Window.Lookup.Handler() {
        @Override
        public void handleLookup(Collection items) {
            if (lookupPickerField.isRefreshOptionsOnLookupClose()) {
                lookupPickerField.getOptionsDatasource().refresh();
            }

            if (isEditable()) {
                if (items == null || items.isEmpty()) return;

                handleLookupInternal(items);

                if (afterLookupSelectionHandler != null) {
                    afterLookupSelectionHandler.onSelect(items);
                }
            }
        }
    }, lookupOpenMode, params);

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


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