/** * Sets the layout to be loaded. If null, the layout specified by the configuration will be * loaded. * * @param defaultLayoutName The default layout name. * @throws Exception Unspecified exception. */ @PropertySetter("layout") public void setLayout(String defaultLayoutName) throws Exception { this.defaultLayoutName = defaultLayoutName; if (desktop != null && !StringUtils.isEmpty(defaultLayoutName)) { loadLayout(defaultLayoutName); } }
@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); } }