• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Window类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Window类属于com.haulmont.cuba.gui.components包,在下文中一共展示了Window类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createBreadCrumbs

import com.haulmont.cuba.gui.components.Window; //导入依赖的package包/类
protected WindowBreadCrumbs createBreadCrumbs() {
    final WindowBreadCrumbs breadCrumbs = new WindowBreadCrumbs();
    breadCrumbs.addListener(
            new WindowBreadCrumbs.Listener() {
                @Override
                public void windowClick(final Window window) {
                    Runnable op = new Runnable() {
                        @Override
                        public void run() {
                            Window currentWindow = breadCrumbs.getCurrentWindow();
                            if (currentWindow != null && window != currentWindow) {
                                if (!isCloseWithCloseButtonPrevented(currentWindow)) {
                                    currentWindow.closeAndRun("close", this);
                                }
                            }
                        }
                    };
                    op.run();
                }
            }
    );
    return breadCrumbs;
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:24,代码来源:DesktopWindowManager.java


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


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


示例4: stateChanged

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


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


示例6: createNextWindowTabShortcut

import com.haulmont.cuba.gui.components.Window; //导入依赖的package包/类
public ShortcutListener createNextWindowTabShortcut(Window.TopLevelWindow topLevelWindow) {
    String nextTabShortcut = clientConfig.getNextTabShortcut();
    KeyCombination combination = KeyCombination.create(nextTabShortcut);

    return new ShortcutListener("onNextTab", combination.getKey().getCode(),
            KeyCombination.Modifier.codes(combination.getModifiers())) {
        @Override
        public void handleAction(Object sender, Object target) {
            TabSheetBehaviour tabSheet = getConfiguredWorkArea(createWorkAreaContext(topLevelWindow))
                    .getTabbedWindowContainer().getTabSheetBehaviour();

            if (tabSheet != null && !hasDialogWindows() && tabSheet.getComponentCount() > 1) {
                Component selectedTabComponent = tabSheet.getSelectedTab();
                String tabId = tabSheet.getTab(selectedTabComponent);
                int tabPosition = tabSheet.getTabPosition(tabId);
                int newTabPosition = (tabPosition + 1) % tabSheet.getComponentCount();

                String newTabId = tabSheet.getTab(newTabPosition);
                tabSheet.setSelectedTab(newTabId);

                moveFocus(tabSheet, newTabId);
            }
        }
    };
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:26,代码来源:WebWindowManager.java


示例7: build

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


示例8: createMenuBarItem

import com.haulmont.cuba.gui.components.Window; //导入依赖的package包/类
protected void createMenuBarItem(Window webWindow, MenuItem item) {
    if (item.isPermitted(session)) {
        AppMenu.MenuItem menuItem = appMenu.createMenuItem(item.getId(), menuConfig.getItemCaption(item.getId()),
                null, createMenuBarCommand(item));

        assignShortcut(webWindow, menuItem, item);
        assignStyleName(menuItem, item);
        assignIcon(menuItem, item);
        assignDescription(menuItem, item);

        createSubMenu(webWindow, menuItem, item, session);

        if (!isMenuItemEmpty(menuItem)) {
            appMenu.addMenuItem(menuItem);
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:18,代码来源:MenuBuilder.java


示例9: createMenuBarItem

import com.haulmont.cuba.gui.components.Window; //导入依赖的package包/类
protected void createMenuBarItem(Window webWindow, SideMenu menu, MenuItem item) {
    if (item.isPermitted(session)) {
        SideMenu.MenuItem menuItem = menu.createMenuItem(item.getId(),
                menuConfig.getItemCaption(item.getId()), null, createMenuBarCommand(item));

        createSubMenu(webWindow, menu, menuItem, item, session);
        assignStyleName(menuItem, item);
        assignIcon(menuItem, item);
        assignDescription(menuItem, item);
        assignExpanded(menuItem, item);
        assignShortcut(webWindow, menuItem, item);

        if (!isMenuItemEmpty(menuItem)) {
            menu.addMenuItem(menuItem);
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:18,代码来源:SideMenuBuilder.java


示例10: dispose

import com.haulmont.cuba.gui.components.Window; //导入依赖的package包/类
/**
 * Release resources right before throwing away this WindowManager instance.
 */
public void dispose() {
    for (WindowOpenInfo openInfo : windowOpenMode.values()) {
        if (openInfo.getOpenMode() == OpenMode.DIALOG) {
            JDialog dialog = (JDialog) openInfo.getData();
            dialog.setVisible(false);
        }
    }

    if (isMainWindowManager) {
        // Stop background tasks
        WatchDog watchDog = AppBeans.get(WatchDog.NAME);
        watchDog.stopTasks();
    }

    // Dispose windows
    for (Window window : windowOpenMode.keySet()) {
        Frame frame = window.getFrame();
        if (frame instanceof Component.Disposable)
            ((Component.Disposable) frame).dispose();
    }

    tabs.clear();
    windowOpenMode.clear();
    stacks.clear();
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:29,代码来源:DesktopWindowManager.java


示例11: setDescription

import com.haulmont.cuba.gui.components.Window; //导入依赖的package包/类
@Override
public void setDescription(String description) {
    this.description = description;

    if (component.isAttached()) {
        com.vaadin.ui.Window dialogWindow = asDialogWindow();
        if (dialogWindow != null) {
            dialogWindow.setDescription(description);
        } else {
            TabSheet.Tab tabWindow = asTabWindow();
            if (tabWindow != null) {
                setTabCaptionAndDescription(tabWindow);
                windowManager.getBreadCrumbs((ComponentContainer) tabWindow.getComponent()).update();
            }
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:18,代码来源:WebWindow.java


示例12: detachCloseListener

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


示例13: setWidth

import com.haulmont.cuba.gui.components.Window; //导入依赖的package包/类
@Override
protected DialogOptions setWidth(Float width, SizeUnit sizeUnit) {
    super.setWidth(width, sizeUnit);

    if (width != null) {
        com.vaadin.ui.Window dialogWindow = asDialogWindow();
        if (dialogWindow != null) {
            if (width < 0) {
                dialogWindow.setWidthUndefined();
                component.setWidthUndefined();
                getContainer().setWidthUndefined();
            } else {
                Unit unit = sizeUnit != null
                        ? WebWrapperUtils.toVaadinUnit(sizeUnit)
                        : Unit.PIXELS;
                dialogWindow.setWidth(width, unit);
                component.setWidth(100, Unit.PERCENTAGE);
            }
        }
    }

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


示例14: init

import com.haulmont.cuba.gui.components.Window; //导入依赖的package包/类
@Override
public void init(Map<String, Object> params) {
    super.init(params);

    fileUpload.addFileUploadSucceedListener(e -> {
        fileId = fileUpload.getFileId();
        fileName = fileUpload.getFileName();
        close(Window.COMMIT_ACTION_ID);
    });

    fileUpload.addFileUploadErrorListener(e -> {
        showNotification(getMessage("notification.uploadUnsuccessful"), NotificationType.WARNING);
        if (e.getCause() != null) {
            log.error("An error occurred while uploading", e.getCause());
        }
    });

    if (AppConfig.getClientType() != ClientType.WEB) {
        dropZone.setVisible(false);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:22,代码来源:FileUploadDialog.java


示例15: showChangePasswordDialog

import com.haulmont.cuba.gui.components.Window; //导入依赖的package包/类
public void showChangePasswordDialog(String token) {
    if (StringUtils.isNotEmpty(token)) {
        // validate the token, and load associated User entity
        final User user = nexbitUserManagementService.getUserForResetPasswordTokenIfValid(token);

        if (user != null) {
            // show change password dialog
            Window changePasswordDialog = openWindow("sec$User.changePassword",
                    WindowManager.OpenType.DIALOG,
                    ParamsMap.of("currentPasswordRequired", false,
                            "cancelEnabled", true,
                            "user", user)
            );
            changePasswordDialog.addCloseListener(actionId -> {
                if (Objects.equals(actionId, COMMIT_ACTION_ID)) {
                    loginField.setValue(user.getLoginLowerCase());
                    // clear password field
                    passwordField.setValue(null);
                    // Set focus in password field
                    passwordField.requestFocus();

                    nexbitUserManagementService.deleteResetPasswordToken(token);
                }
            });
        } else {
            showNotification(messages.getMessage(NexbitAppLoginWindow.class, "resetPassword.invalidToken"),
                    NotificationType.ERROR);
        }
    }
}
 
开发者ID:pfurini,项目名称:cuba-component-forgot-password,代码行数:31,代码来源:NexbitAppLoginWindow.java


示例16: findTab

import com.haulmont.cuba.gui.components.Window; //导入依赖的package包/类
protected JComponent findTab(Integer hashCode) {
    Set<Map.Entry<JComponent, WindowBreadCrumbs>> set = tabs.entrySet();
    for (Map.Entry<JComponent, WindowBreadCrumbs> entry : set) {
        Window currentWindow = entry.getValue().getCurrentWindow();
        if (hashCode.equals(getWindowHashCode(currentWindow)))
            return entry.getKey();
    }
    return null;
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:10,代码来源:DesktopWindowManager.java


示例17: onOk

import com.haulmont.cuba.gui.components.Window; //导入依赖的package包/类
public void onOk() {
    if (productTypeField.getValue() == null) {
        showNotification("Select a value", NotificationType.HUMANIZED);
    } else {
        close(Window.COMMIT_ACTION_ID);
    }
}
 
开发者ID:cuba-platform,项目名称:sample-data-manipulation,代码行数:8,代码来源:ProductTypeDialog.java


示例18: init

import com.haulmont.cuba.gui.components.Window; //导入依赖的package包/类
@Override
public void init(Map<String, Object> params) {
    super.init(params);

    filesTable.addAction(new ItemTrackingAction("download")
            .withCaption(getMessage("download"))
            .withHandler(event -> {
                FileDescriptor fileDescriptor = filesTable.getSingleSelected();
                if (fileDescriptor != null) {
                    exportDisplay.show(fileDescriptor, null);
                }
            }));

    BaseAction multiUploadAction = new BaseAction("multiupload")
            .withCaption(getMessage("multiupload"))
            .withHandler(event -> {
                if (!security.isEntityOpPermitted(FileDescriptor.class, EntityOp.READ)) {
                    throw new AccessDeniedException(PermissionType.ENTITY_OP, FileDescriptor.class.getSimpleName());
                }

                Window window = openWindow("multiuploadDialog", OpenType.DIALOG);
                window.addCloseListener(actionId -> {
                    if (COMMIT_ACTION_ID.equals(actionId)) {
                        Collection<FileDescriptor> items = ((MultiUploader) window).getFiles();
                        for (FileDescriptor fdesc : items) {
                            boolean modified = filesDs.isModified();
                            filesDs.addItem(fdesc);
                            ((DatasourceImplementation) filesDs).setModified(modified);
                        }

                        filesTable.requestFocus();
                    }
                });
            });

    multiUploadAction.setEnabled(security.isEntityOpPermitted(FileDescriptor.class, EntityOp.CREATE));
    multiUploadBtn.setAction(multiUploadAction);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:39,代码来源:FileBrowser.java


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


示例20: openEditor

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ConfigGuiType类代码示例发布时间:2022-05-23
下一篇:
Java EntitySnowman类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap