/** * Loads a layout from the specified resource. * * @param resource The layout resource to load. * @throws Exception Unspecified exception. */ public void loadLayout(String resource) throws Exception { layout = LayoutParser.parseResource(resource); FrameworkUtil.setAppName(layout.getName()); if (layout.isEmpty()) { DialogUtil.showError(LBL_NO_LAYOUT); } else { buildUI(layout); } }
/** * Prompts to load layout. */ @EventHandler(value = "click", target = "mnuLoadLayout") private void onClick$mnuLoadLayout() { LayoutManager.show(false, shell.getUILayout().getName(), (event) -> { LayoutIdentifier layoutId = event.getTarget().getAttribute("layoutId", LayoutIdentifier.class); if (layoutId != null) { Layout newLayout = new Layout(LayoutParser.parseProperty(layoutId)); shell.buildUI(newLayout); } }); }