protected Window getWindow() { Window window = ComponentsHelper.getWindowImplementation(filter); if (window == null) throw new IllegalStateException(String.format("Cannot get window for filter %s", filter.getId())); return window; }
protected void build(SideMenu menu, List<MenuItem> rootItems) { Window window = ComponentsHelper.getWindowImplementation(menu); if (window == null) { throw new IllegalStateException("SideMenu is not belong to Window"); } for (MenuItem menuItem : rootItems) { // AppMenu does not support separators if (menuItem.isPermitted(session) && !menuItem.isSeparator()) { createMenuBarItem(window, menu, menuItem); } } removeExtraSeparators(menu); }
protected void build(AppMenu appMenu, List<MenuItem> rootItems) { this.appMenu = appMenu; Window window = ComponentsHelper.getWindowImplementation(appMenu); if (window == null) { throw new IllegalStateException("AppMenu is not belong to Window"); } for (MenuItem menuItem : rootItems) { // AppMenu does not load top-level separators if (menuItem.isPermitted(session) && !menuItem.isSeparator()) { createMenuBarItem(window, menuItem); } } removeExtraSeparators(); }
protected FilterEntity getDefaultFilter(List<FilterEntity> filters) { Window window = ComponentsHelper.getWindowImplementation(filter); if (window == null) { throw new IllegalStateException("There is no window set for filter");
protected void setupUpdateTimer() { if (webConfig.getFoldersPaneEnabled()) { 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); } } }