/** * */ protected void buildEllypsisMenu() { if ((this.ellypsisMenuConfiguration != null) && ellypsisMenuConfiguration.hasSubComponent()) { ellypisMenu = ToolbarUtils.ellipsisVActionsButton(ellypsisMenuConfiguration, controller, null); } }
/** * <component id="EllipsisMenuActions"> <component ref="DeleteSelectedRows"/> * <component ref="AddToFavorisRows"/> <component ref="AddToSelectedRows"/> </component> */ // @formatter:on private void buildEllipsisMenu() { final VLViewComponentXML moreActionsConfig = ComponentUtils.resolveComponent(tableConfiguration, "EllipsisMenuActions"); if (moreActionsConfig != null && moreActionsConfig.hasSubComponent()) { // ellispsis = ComponentToContextMenuHelper // .ellipsisVActionsButton(moreActionsConfig.getSubcomponents(), // controller, // tableView.criteriaContext()); // ellispsis.managedProperty().bind(ellispsis.visibleProperty()); // ellispsis.visibleProperty().bind(Bindings.size(tableView.getTableView().getItems()).greaterThan(0)); } }
public VLViewComponentXML getEllipsisMenuConfiguration() { if ((configuration != null) && configuration.hasSubComponent()) { for (VLViewComponentXML subComp : configuration.getSubcomponents()) { if (subComp.getId().equalsIgnoreCase("EllipsisMenu")) { return subComp; } } } return null; }
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; }
/** * Get first subcomponent given identifier. * * @param id * @return */ public Optional<VLViewComponentXML> getComponentById(String id) { if (hasSubComponent()) { for (final VLViewComponentXML comp : getSubcomponents()) { if (id.equalsIgnoreCase(comp.getId())) { return Optional.of(comp); } } } return Optional.empty(); }
protected void buildDefaultActions() { if (defaultActionsConfiguration != null && defaultActionsConfiguration.hasSubComponent()) { defaultActions = ComponentUtils.resolveAndGenerate(controller, defaultActionsConfiguration.getSubcomponents()); } }
protected void buildTabs() { // leftTabs VLViewComponentXML leftTabsCfg = configuration.getNullableComponentById("LeftTabs"); if (leftTabsCfg != null && leftTabsCfg.hasSubComponent()) { buildTabsGroup(leftTabsCfg, TabSide.LEFT); } // right tabs VLViewComponentXML rightTabsCfg = configuration.getNullableComponentById("RightTabs"); if (rightTabsCfg != null && rightTabsCfg.hasSubComponent()) { buildTabsGroup(rightTabsCfg, TabSide.RIGHT); } // center tabs VLViewComponentXML centerTabsCfg = configuration.getNullableComponentById("CenterTabs"); if (centerTabsCfg != null && centerTabsCfg.hasSubComponent()) { buildTabsGroup(centerTabsCfg, TabSide.CENTER); } }
/** * Generates an hyperlink with ELLIPSIS_V. */ public static EllipsisActionButton ellipsisVActionsButton(VLViewComponentXML moreActionConfig, final AbstractViewController controller, final CriteriaContext criteriaContext) { final EllipsisActionButton ellipsisButton = new EllipsisActionButton(); ellipsisButton.setVerlical(); if (moreActionConfig != null && moreActionConfig.hasSubComponent()) { ellipsisButton.build(moreActionConfig, controller, criteriaContext); } return ellipsisButton; }
/** * @{inheritedDoc} */ @Override public void count(IEmaginController controller, IOperationResult currentPage, Consumer<IOperationResult> consumer) { IOperationResult operationResult = new SingleResult(); if (rootData == null) { operationResult.addMetaData("totalElements", 0); consumer.accept(operationResult); return; } if (rootData.hasSubComponent()) { operationResult.addMetaData("totalElements", rootData.getSubcomponents().size()); consumer.accept(operationResult); return; } operationResult.addMetaData("totalElements", 0); consumer.accept(operationResult); return; }
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()); } } }
/** * @{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); } } }
public void buildActions() { NodeHelper.setHVGrow(rightActionsLayout); rightActionsLayout.setAlignment(Pos.BOTTOM_RIGHT); rightActionsLayout.setSpacing(4); final VLViewComponentXML comp = ComponentUtils.resolveComponent(tabDefinition, ACTIONS_PATH); if (comp != null) { if (comp.hasSubComponent()) { final List<VLViewComponentXML> resolvedComponents = ComponentUtils.resolveDefinitions(controller, comp.getSubcomponents()); List<IBuildable> buildables = ComponentUtils.generate(controller, resolvedComponents); for (final IBuildable buildable : buildables) { rightActionsLayout.getChildren().add(buildable.getDisplay()); } } } }
/** * Process tabs building */ protected void buildTabsArea() { if (tabComponents != null) { if (tabComponents != null && tabComponents.getSubcomponents() != null && tabComponents.hasSubComponent()) { for (final VLViewComponentXML tabDefinition : tabComponents.getSubcomponents()) { // Process tab and its title final String title = tabDefinition.getPropertyValue(XMLConstants.TITLE); final QuaternaryMenuTab styledTab = new QuaternaryMenuTab(tabDefinition, controller.getLocalised(title)); styledTab.setInternalId(tabDefinition.getId()); addTab(styledTab); } } if (!getTabs().isEmpty()) { selectTab(getTabs().get(0)); } } }