@Override protected void onAttach(Page page) { try { CommandUtil.associateCommand("help", this); getPage().addChild(messageWindow = new MessageWindow()); addChild(registeredStyles); desktop = new ElementDesktop(this); setLogoutConfirm(logoutConfirm); String confirmClose = getAppProperty("confirmClose", "CAREWEB.CONFIRM.CLOSE"); if (StringUtils.isEmpty(confirmClose) || BooleanUtils.toBoolean(confirmClose)) { ClientUtil.canClose(false); } String layout = defaultLayoutName != null ? defaultLayoutName : getAppProperty("layout", "CAREWEB.LAYOUT.DEFAULT"); if (!StringUtils.isEmpty(layout)) { loadLayout(layout); } } catch (Exception e) { log.error("Error initializing the shell.", e); throw MiscUtil.toUnchecked(e); } }
public ElementDesktop(CareWebShell shell) throws Exception { super(); this.shell = shell; desktopOuter = createFromTemplate(); setOuterComponent(desktopOuter); setInnerComponent(desktopInner); menubar = new ElementMenubar(menubar1); toolbar = new ElementToolbar(toolbar1); ActionUtil.addAction(mnuAbout, "groovy:org.carewebframework.shell.CareWebUtil.about();"); ActionUtil.addAction(mnuTOC, "groovy:org.carewebframework.shell.CareWebUtil.showHelpTOC();"); fixedHelpItems = helpMenu.getChildCount(); sortHelpMenu = false; helpMenu.addEventListener("open", (event) -> { if (sortHelpMenu) { sortHelpMenu(); } }); if (SecurityUtil.isGrantedAny(DesignConstants.DESIGN_MODE_PRIVS)) { DesignMenu.create(this, menubar0); } addChild(menubar); addChild(toolbar); setTitle(getTitle()); shell.addChild(desktopOuter); }