/** * {@inheritDoc} */ @Override public String getInternalId() { return configuration.getId(); }
/** * @param wizardConfiguration the wizardConfiguration to set */ public void setConfiguration(VLViewComponentXML configuration) { this.configuration = configuration; id = configuration.getId(); }
/** * {@inheritDoc} */ @Override public String getInternalId() { return configuration.getId(); }
/** * Root component is the one with id = Content * * @return */ public VLViewComponentXML getRootComponent() { if (components == null) { return null; } for (final VLViewComponentXML componentXML : components) { if (CONTENT.equals(componentXML.getId())) { return componentXML; } } return null; }
/** * @{inheritedDoc} */ @Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { this.configuration = configuration; this.controller = (AbstractViewController) controller; id = configuration.getId(); controller.addIComponent(this); }
/** * Default Constructor */ public ColumnsDef(VLViewComponentXML columnConfig, TableColumnBase column) { this.columnConfig = columnConfig; responsiveOrder = columnConfig.getResponsiveOrder(); columnId = columnConfig.getId(); this.column = column; } }
public VLViewComponentXML getEllipsisMenuConfiguration() { if ((configuration != null) && configuration.hasSubComponent()) { for (VLViewComponentXML subComp : configuration.getSubcomponents()) { if (subComp.getId().equalsIgnoreCase("EllipsisMenu")) { return subComp; } } } return null; }
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(); }
/** * Get first subcomponent given identifier. * * @param id * @return */ public List<VLViewComponentXML> getComponentsById(String id) { List<VLViewComponentXML> comps = new ArrayList<>(); if (hasSubComponent()) { for (final VLViewComponentXML comp : getSubcomponents()) { if (id.equalsIgnoreCase(comp.getId())) { comps.add(comp); } } } return comps; }
/** * Returns the first {@link VLViewComponentXML} with given identifier in * this view wizardConfiguration. * * @param id * @return Optional */ public Optional<VLViewComponentXML> getComponentById(String id) { if (getComponents() == null || getComponents().isEmpty()) { return Optional.empty(); } for(VLViewComponentXML comp: getComponents()) { if(id.equalsIgnoreCase(comp.getId())) { return Optional.of(comp); } } return Optional.empty(); }
/** * @param key * @param config * @return */ @Override public String getLocalised(String key, VLViewComponentXML config) { if(messageSource == null) { return "__I18N__"; } String message = messageSource.get(key); if (StringUtils.isBlank(message) && config.getId().startsWith("Core")) { return getGLocalised(key); } return message; }
/** * Constructor * * @param cssStyle * @param config * @param text */ public VLTab(AbstractViewController tabPaneController, VLViewComponentXML tabDefinition, String cssStyle) { this.config = tabDefinition; this.tabPaneController = tabPaneController; this.internalId = tabDefinition.getId(); // Process tab and its title final String text = tabDefinition.getPropertyValue(XMLConstants.TITLE); this.title = new Label(); this.title.setText(tabPaneController.getLocalised(text)); this.title.getStyleClass().add(TAB_ITEM_TITLE_CSS); IconUtils.setIcon(title, tabDefinition); getStyleClass().add(cssStyle); getChildren().add(title); NodeHelper.setHgrow(this, contentWrapper); }
/** * Build the title * * @param blocConfig * @return */ protected void buildLabel() { setId(MessageFormat.format("fieldset-title{0}", configuration.getId())); final Label label = new Label(); NodeHelper.setTitle(label, configuration, controller); NodeHelper.styleClassSetAll(label, configuration, "titleStyleClass", "form-fieldset-title"); NodeHelper.styleClassSetAll(this, configuration, "headerStyleClass", "form-fieldset-header"); this.title = label.getText(); getChildren().addAll(label); }
/** * 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)); } } }
/** * @param tabsid * @param config * @param text */ public VLTab(AbstractViewController controller, VLViewComponentXML tabDefinition) { this.config = tabDefinition; this.tabPaneController = controller; this.internalId = tabDefinition.getId(); String styleClass = tabDefinition.getPropertyValue("styleClass"); if (StringUtils.isNotBlank(styleClass)) { getStyleClass().addAll(styleClass.split(",")); } else { getStyleClass().add(TAB_ITEM_CSS); } this.title = new Label(); NodeHelper.setTitle(title, tabDefinition, controller); // title.setContentDisplay(ContentDisplay.LEFT); String titleStyleClass = tabDefinition.getPropertyValue("titleStyleClass"); if (StringUtils.isNotBlank(titleStyleClass)) { title.getStyleClass().addAll(titleStyleClass.split(",")); } else { title.getStyleClass().add(TAB_ITEM_TITLE_CSS); } IconUtils.setIcon(title, tabDefinition); getChildren().add(title); NodeHelper.setHVGrow(contentWrapper); }
/** * 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 HeaderTab styledTab = new HeaderTab(tabDefinition, controller.getLocalised(title)); styledTab.setInternalId(tabDefinition.getId()); addTab(styledTab); } } if (!getTabs().isEmpty()) { selectTab(getTabs().get(0)); } } }
/** * @{inheritedDoc} */ @SuppressWarnings("unchecked") @Override public void handle(MouseEvent event) { if (event.getClickCount() == 1) { List<VLViewComponentXML> sub = (List<VLViewComponentXML>) getForData().getMeta().get("subComponents"); boolean hassub = false; if (sub != null) { for (VLViewComponentXML s : sub) { if (s.getId().equals("Handler")) { hassub = true; getForData().getMeta().put("parentItem", this); ComponentToButtonBaseHelper.setButtonActions(controller, s, null, event, getForData()); } } } if (!hassub) { // forward to empty page PushStructureContentEvent ev = new PushStructureContentEvent.Builder().viewId("DemoEmptyPrefenceView").model(getForData()).build(); controller.dispatchEvent(ev); } } }
/** * Generates an hyperlink from a component * * @param controller * @param actionDefinition * @return Button */ public static MenuItem menuItemFrom(final AbstractViewController controller, final VLViewComponentXML actionDefinition) { final MenuItem menuItem = new MenuItem(); menuItem.setId(actionDefinition.getId()); final String title = actionDefinition.getPropertyValue(XMLConstants.LABEL); if (!StringUtils.isEmpty(title)) { menuItem.setText(controller.getLocalised(title)); } Label label = new Label(); IconUtils.setIcon(label, actionDefinition); menuItem.setGraphic(label); setOnAction(actionDefinition, menuItem, controller); return menuItem; } }
if (realConfig != null && !ACTIONS.equals(realConfig.getId())) {