/** * */ public void addSubconfg(VLViewComponentXML config) { if (getSubcomponents() == null) { subcomponents = new ArrayList<>(); } subcomponents.add(config); }
/** * Generates the components from the given configuration. * * @param groupDefinition * @return List */ public List<IBuildable> buildActionGroup(VLViewComponentXML groupDefinition) { if (groupDefinition == null) { return new ArrayList<>(); } List<IBuildable> buildables = ComponentUtils.resolveAndGenerate(controller, groupDefinition.getSubcomponents()); if (buildables == null) { return new ArrayList<>(); } return buildables; } }
public VLViewComponentXML getEllipsisMenuConfiguration() { if ((configuration != null) && configuration.hasSubComponent()) { for (VLViewComponentXML subComp : configuration.getSubcomponents()) { if (subComp.getId().equalsIgnoreCase("EllipsisMenu")) { return subComp; } } } return null; }
@Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { this.controller = (AbstractViewController) controller; List<IBuildable> links = ComponentUtils.resolveAndGenerate((AbstractViewController) controller, configuration.getSubcomponents()); if (links.size() > 1) { // prohibited!!!! but .. } if (links.size() == 1) { primaryMenuButton = links.get(0); Node button = primaryMenuButton.getDisplay(); topToolbar.getChildren().add(0, button); } }
private boolean hasMultipleElementsOnRow(VLViewComponentXML rowConfig) { VLViewComponentXML rowsConfig = rowConfig.getComponentById("Rows").orElse(null); return rowsConfig != null && rowsConfig.hasSubComponent() && rowsConfig.getSubcomponents().size() > 1; }
public VLViewComponentXML getContextMenuConfiguration() { if ((configuration != null) && configuration.hasSubComponent()) { for (VLViewComponentXML subComp : configuration.getSubcomponents()) { if (subComp.getId().equalsIgnoreCase("ContextMenu")) { return subComp; } } } return null; }
protected void buildDefaultActions() { if (defaultActionsConfiguration != null && defaultActionsConfiguration.hasSubComponent()) { defaultActions = ComponentUtils.resolveAndGenerate(controller, defaultActionsConfiguration.getSubcomponents()); } }
protected void buildTabGroup(VLViewComponentXML tabGroupConfig) { for (VLViewComponentXML tabConfig : tabGroupConfig.getSubcomponents()) { VLTab tab = new VLTab(controller, tabConfig); tab.addEventFilter(MouseEvent.MOUSE_CLICKED, e -> selectTab(tab)); tabs.add(tab); } }
protected void buildTopToolbar(AbstractViewController controller, VLViewComponentXML configuration) { List<IBuildable> links = ComponentUtils.resolveAndGenerate(controller, configuration.getSubcomponents()); NodeHelper.styleClassSetAll(topToolbar, configuration, EP_HEADER_LEFT_TOOLBAR_TOP); for (final IBuildable action : links) { topToolbar.getChildren().add(action.getDisplay()); } }
public void buildTabs(VLViewComponentXML rootComponent) { VLViewComponentXML detailsViewTabs = rootComponent.getComponentById("DetailsViewTabs").orElse(null); if (detailsViewTabs != null && detailsViewTabs.hasSubComponent()) { for (VLViewComponentXML tabGroupConfig : detailsViewTabs.getSubcomponents()) { buildTabGroup(tabGroupConfig); } } // select first tab selectTab(0); }
/** * Resolve all subcomponents from toResolveActionsCfg. These subcomponents must have not empty * reference. Only subcomponents with non empty reference attribute will be treated. * * @param from * @param rootComponent */ public static List<VLViewComponentXML> resolveReferencedSubComponents(final AbstractViewController controller, final VLViewComponentXML from) { Assert.notNull(controller); Assert.notNull(from); if (from.hasSubComponent()) { return resolveDefinitions(controller, from.getSubcomponents()); } return new ArrayList<>(); }
protected void buildHeader() { VLViewComponentXML rootComp = controller.getRootComponent(); VLViewComponentXML header = rootComp.getComponentById("Header").orElse(null); if (header != null && header.hasSubComponent()) { List<IBuildable> buildables = ComponentUtils.resolveAndGenerate(controller, header.getSubcomponents()); for(IBuildable e: buildables) { maximizedMenu.getChildren().add(0, e.getDisplay()); } } }
public void build(VLViewComponentXML configuration, AbstractViewController controller, CriteriaContext criteriaContext) { List<VLViewComponentXML> configurations = configuration.getSubcomponents(); build(configurations, controller, criteriaContext, null); String ellipsysStyleClass = configuration.getPropertyValue("ellipsysStyleClass"); if (StringUtils.isNotBlank(ellipsysStyleClass)) { ellipsisButton.getStyleClass().addAll(ellipsysStyleClass.split(",")); } }
/** * @{inheritedDoc} */ @Override public Node present(IEmaginController controller, VLViewComponentXML configuration, Object item) { HBox node = new HBox(); node.setStyle("-fx-alignment:CENTER; -fx-spacing:4"); if(configuration.hasSubComponent()) { for(VLViewComponentXML c: configuration.getSubcomponents()) { Node n = _present(controller, c, item); node.getChildren().add(n); } } return node; }
/** * Constructor */ @Override public void buildFrom(IEmaginController controller, VLViewComponentXML blocConfig) { VLViewComponentXML headerActions = blocConfig.getComponentById("HeaderActions").orElse(null); NodeHelper.styleClassSetAll(getDisplay(), headerActions, "styleClass", "ep-form-bloc-title-pane-header-actions-wrapper"); if (headerActions != null && headerActions.hasSubComponent()) { List<IBuildable> buildables = ComponentUtils.resolveAndGenerate((AbstractViewController) controller, headerActions.getSubcomponents()); for(IBuildable e: buildables) { getChildren().add(e.getDisplay()); } } }
/** * Buils all tabs */ protected void buildTabs() { VLViewComponentXML tabsConfiguration = rootConfiguration.getComponentById("ListViewTabs").orElse(null); if ((tabsConfiguration != null) && tabsConfiguration.hasSubComponent()) { for (VLViewComponentXML tabConfig : tabsConfiguration.getSubcomponents()) { String contentImpl = tabConfig.getPropertyValue("contentImpl"); if (StringUtils.isNotBlank(contentImpl)) { ListViewTab listViewTab = (ListViewTab) Services.getBean(contentImpl); listViewTab.setListviewPaneContent(this); listViewTab.buildFrom((IEmaginController) controller, tabConfig); tabs.add(listViewTab); } } } }
protected void buildFooter() { VLViewComponentXML rootComp = controller.getRootComponent(); VLViewComponentXML footer = rootComp.getComponentById("Footer").orElse(null); maximizedMenu.getChildren().addAll(NodeHelper.verticalSpacer()); if (footer != null && footer.hasSubComponent()) { List<IBuildable> buildables = ComponentUtils.resolveAndGenerate(controller, footer.getSubcomponents()); for(IBuildable e: buildables) { maximizedMenu.getChildren().add(e.getDisplay()); } } }
private void buildHeaderActions() { VLViewComponentXML root = getRootComponent(); VLViewComponentXML headerActions = root.getComponentById("HeaderActions").orElse(null); if (headerActions != null) { // we dislay only right actions the DONE button VLViewComponentXML rightActions = headerActions.getComponentById("RightActions").orElse(null); if ((rightActions != null) && rightActions.hasSubComponent()) { List<IBuildable> actions = ComponentUtils.resolveAndGenerate(this, rightActions.getSubcomponents()); // set header actions HeaderNavbarSetCustomRightActions ev = new HeaderNavbarSetCustomRightActions.Builder().actions(actions).build(); dispatchEvent(ev); } } }
/** * @{inheritedDoc} */ @Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { List<IBuildable> links = ComponentUtils.resolveAndGenerate((AbstractViewController) controller, configuration.getSubcomponents()); NodeHelper.styleClassSetAll(topToolbar, configuration, "header-center-toolbar"); for (final IBuildable action : links) { action.getDisplay().setFocusTraversable(false); addItem(action.getDisplay()); } }
protected void buildTabsGroup(VLViewComponentXML groupConfiguration, TabSide side) { for (final VLViewComponentXML tabConfig : groupConfiguration.getSubcomponents()) { String styleClass = groupConfiguration.getPropertyValue("styleClass"); if (StringUtils.isEmpty(styleClass)) { final VLTab tab = new VLTab(controller, tabConfig); addTab(tab, side); } else { final VLTab tab = new VLTab(controller, tabConfig, styleClass); addTab(tab, side); } } }