/** * @{inheritedDoc} */ @Override public VLViewComponentXML getToolbarConfiguration() { final VLViewComponentXML actionsModelConf = configuration.getComponentById(ACTIONS).orElse(null); VLViewComponentXML result = null; if (actionsModelConf != null) { String model = actionsModelConf.getModel(); if (model != null) { result = ComponentUtils.resolveDefinition(controller, model).orElse(null); return result; } } return result; }
/** * Components are list of referenced components to resolver in this controller or parent controller. * * @param components * @param controller * @return List */ public static List<VLViewComponentXML> resolveDefinitions(final AbstractViewController controller, final List<VLViewComponentXML> refs) { Assert.notNull(controller); Assert.notNull(refs); List<VLViewComponentXML> result = new ArrayList<>(); if (!refs.isEmpty()) { for(VLViewComponentXML e : refs) { VLViewComponentXML optional = resolveDefinition(controller, e).orElse(null); if (optional != null) result.add(optional); //else System.out.println("Not resolved configuration component -> " + e.getReference()); } } return result; }
/** * @param identifier * @return */ protected Optional<VLViewComponentXML> getStructureContentConfig(String identifier) { final VLViewComponentXML rootComp = getRootComponent(); if (rootComp != null) { final String structureContentConfig = rootComp.getPropertyValue(identifier); if (StringUtils.isNotBlank(structureContentConfig)) { return ComponentUtils.resolveDefinition(this, structureContentConfig); } } return Optional.empty(); }
/** * Resolve the model with the given identifier. Sometimes, the source {@link VLViewComponentXML} * holds some attributes to copied in the destination. * * @param controller * @param ref * @return VLViewComponentXML */ public static Optional<VLViewComponentXML> resolveDefinition(AbstractViewController controller, VLViewComponentXML ref) { Assert.notNull(controller); Assert.notNull(ref); // sometimes holds processor or controller not reference to something to // build if (StringUtils.isNotBlank(ref.getReference())) { Optional<VLViewComponentXML> optional = resolveDefinition(controller, ref.getReference()); optional.ifPresent(solved -> { copySourcesAttributes(ref, solved); }); return optional; } return Optional.empty(); }
/** * @{inheritedDoc} */ @Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { if (configuration != null && configuration.hasSubComponent()) { int index = 0; for (VLViewComponentXML refbtnConfig : configuration.getSubcomponents()) { VLViewComponentXML btnConfig = ComponentUtils.resolveDefinition((AbstractViewController)controller, refbtnConfig.getReference()).orElse(null); if (btnConfig != null) { String type = btnConfig.getPropertyValue("type", "FormInlineAction"); InlineAction action = (InlineAction) ComponentUtils.build(type, (AbstractViewController)controller, btnConfig); action.setRow(row, callerIndex); getChildren().add(action.getDisplay()); if(index == 0) { defaultInlineAction = action; } index++; } } } }
VLViewComponentXML conf = ComponentUtils.resolveDefinition((AbstractViewController)getController(), "HeaderActions").orElse(null); if (conf != null) { Node actions = ViewActionFactory.viewActions((AbstractViewController) controller, conf);
private void build() { maximizedWrapper.getChildren().clear(); topToolbar.getChildren().clear(); NodeHelper.styleClassSetAll(maximizedWrapper, configuration, HEADER_RIGHT_TOOLBAR); NodeHelper.styleClassSetAll(customWrapper, configuration, HEADER_RIGHT_TOOLBAR); final Iterator<VLViewComponentXML> it = configuration.getSubcomponents().iterator(); while (it.hasNext()) { final VLViewComponentXML conf = it.next(); // can be reference or controller if (StringUtils.isNotBlank(conf.getController())) { final String controller = conf.getController(); final AbstractViewController viewController = StandardViewUtils.forId(this.controller.getRootStructure(), controller); maximizedWrapper.getChildren().add(viewController.processedView()); } else { final VLViewComponentXML resolved = ComponentUtils.resolveDefinition(controller, conf).orElse(null); if (resolved != null) { final IBuildable buildable = ComponentUtils.generate(controller, resolved); NodeHelper.setTransparentFocus(buildable.getDisplay()); maximizedWrapper.getChildren().addAll(buildable.getDisplay()); } } if (conf.isSeparatorAfter() && it.hasNext()) { maximizedWrapper.getChildren().addAll(NodeHelper.headerVerticalSeparator()); } } bottomToolbar.setVisible(false); ellispsys = ToolbarUtils.ellipsisVActionsButton(configuration, controller, null); animateAddMaximizedWrapper(); }
VLViewComponentXML conf = ComponentUtils.resolveDefinition((AbstractViewController)getController(), "HeaderActions").orElse(null); if (conf != null) { Node actions = ViewActionFactory.viewActions((AbstractViewController) controller, conf);
final VLViewComponentXML attributeCfg = ComponentUtils.resolveDefinition(controller, attrID).orElse(null);
realConfig = ComponentUtils.resolveDefinition((AbstractViewController)controller, fieldsetConfig.getReference()).orElse(null);
/** * @{inheritedDoc} */ @Override protected void process() { super.process(); VLViewComponentXML root = getRootComponent(); String notifiableComponent = root.getPropertyValue("notifiableComponent"); if (StringUtils.isNotBlank(notifiableComponent)) { VLViewComponentXML notifiableComponentCgf = ComponentUtils.resolveDefinition(this, notifiableComponent).orElse(null); button = new SimpleCountableHyperlinkButton(); button.buildFrom(this, notifiableComponentCgf); processedView(button.getDisplay()); } String delegateId = getRootComponent().getPropertyValue("countDelegate"); button.countProperty().bind(newElementsCount); if (StringUtils.isNotBlank(delegateId)) { countDelegate = (INotificationsManagement) Services.getBean(delegateId); OperationCallback countCallback = new OperationCallback.Builder().onSuccess(this::onCountNewElementsSuccess).build(); countDelegate.getLocalElementsCount(NotificationStatus.NEW.status(), countCallback); countDelegate.getRemoteElementsCount(NotificationStatus.NEW.status(), countCallback); } }
realConfig = ComponentUtils.resolveDefinition((AbstractViewController)controller, fieldsetConfig.getReference()).orElse(null);