private HTMLElement defaultOption() { final HTMLElement option = Window.getDocument().createElement("option"); option.setAttribute("value", ""); option.setAttribute("disabled", ""); option.setAttribute("selected", ""); option.setTextContent(translationService.getTranslation(SourceConfigurationPageView_SelectOption_placeholder)); return option; }
private HTMLElement defaultOption() { final HTMLElement option = Window.getDocument().createElement("option"); option.setAttribute("value", ""); option.setAttribute("disabled", ""); option.setAttribute("selected", ""); option.setTextContent(translationService.getTranslation(SourceConfigurationPageView_SelectOption_placeholder)); return option; }
void updateDataUUID() { getElement().setAttribute("data-uuid", getItem().getUUID()); }
void updateTitle() { getElement().setAttribute("title", getItem().getLabel()); }
private void setupOtherwisePopover() { miOtherwiseCell.getMenuItemView().getElement().setAttribute("data-toggle", "popover"); popoverUtils.setupPopover(miOtherwiseCell.getMenuItemView().getElement(), ts.getTranslation(GuidedDecisionTableErraiConstants.EditMenu_otherwiseDescription)); }
private void setupOtherwisePopover() { miOtherwiseCell.getMenuItemView().getElement().setAttribute("data-toggle", "popover"); popoverUtils.setupPopover(miOtherwiseCell.getMenuItemView().getElement(), ts.getTranslation(GuidedDecisionTableErraiConstants.EditMenu_otherwiseDescription)); }
private static void mergeAttribute(final DataFieldMeta meta, final HTMLElement beanElement, final HTMLElement templateElement, final String name, final String value) { final ConflictStrategy strategy = meta.getStrategy(name); // Merge all class names regardless of strategy if (name.equals("class")) { DOMUtil.tokenStream(templateElement.getClassList()) .filter(token -> !beanElement.getClassList().contains(token)) .forEach(token -> beanElement.getClassList().add(token)); } // Merge individual properties in style only using the strategy when both elements have a value. else if (name.equals("style")) { Stream<String> propertyNameStream = DOMUtil.cssPropertyNameStream(templateElement.getStyle()); if (ConflictStrategy.USE_BEAN.equals(strategy)) { propertyNameStream = propertyNameStream .filter(propertyName -> { final String beanPropertyValue = beanElement.getStyle().getPropertyValue(propertyName); return beanPropertyValue == null || beanPropertyValue.isEmpty(); }); } propertyNameStream .forEach(propertyName -> beanElement.getStyle().setProperty(propertyName, templateElement.getStyle().getPropertyValue(propertyName), "")); } // Use strategy to decide which value is used. else { final String beanValue = beanElement.getAttribute(name); if (ConflictStrategy.USE_TEMPLATE.equals(strategy) || beanValue == null || beanValue.isEmpty()) { beanElement.setAttribute(name, value); } } }
private static void mergeAttribute(final DataFieldMeta meta, final HTMLElement beanElement, final HTMLElement templateElement, final String name, final String value) { final ConflictStrategy strategy = meta.getStrategy(name); // Merge all class names regardless of strategy if (name.equals("class")) { DOMUtil.tokenStream(templateElement.getClassList()) .filter(token -> !beanElement.getClassList().contains(token)) .forEach(token -> beanElement.getClassList().add(token)); } // Merge individual properties in style only using the strategy when both elements have a value. else if (name.equals("style")) { Stream<String> propertyNameStream = DOMUtil.cssPropertyNameStream(templateElement.getStyle()); if (ConflictStrategy.USE_BEAN.equals(strategy)) { propertyNameStream = propertyNameStream .filter(propertyName -> { final String beanPropertyValue = beanElement.getStyle().getPropertyValue(propertyName); return beanPropertyValue == null || beanPropertyValue.isEmpty(); }); } propertyNameStream .forEach(propertyName -> beanElement.getStyle().setProperty(propertyName, templateElement.getStyle().getPropertyValue(propertyName), "")); } // Use strategy to decide which value is used. else { final String beanValue = beanElement.getAttribute(name); if (ConflictStrategy.USE_TEMPLATE.equals(strategy) || beanValue == null || beanValue.isEmpty()) { beanElement.setAttribute(name, value); } } }
@Override public void renderForInputId(String inputId, String label, boolean required, String helpMessage) { init(); getElement().appendChild(labelText); labelText.setTextContent(label); getElement().setAttribute("for", inputId); setRequired(required); setHelpMessage(helpMessage); }