public String formatValues() { StringBuilder out = new StringBuilder(); forEach(item -> out.append(item.getProperty()).append(":").append(item.getValue()).append(";")); return out.toString(); }
protected void applyCssToElement(Map<String,String> properties, IsWidget element) { if (properties != null && !properties.isEmpty()) { final Style style = element.asWidget().getElement().getStyle(); cssPropertiesHelper.readCssValues(properties) .stream().forEach(cssValue -> { String prop = cssValue.getPropertyInCamelCase(); String val = cssValue.getValue(); style.setProperty(prop, val); }); } } }
public CssValue getValue(CssProperty property) { for (CssValue cssValue : this) { if (cssValue.getProperty().equals(property.getName())) { return cssValue; } } return null; }
public CssValue setValue(CssProperty property, String value) { CssValue cssValue = getValue(property); if (cssValue == null) { if (value != null && value.length() > 0) { cssValue = new CssValue(property.getName(), value); this.add(cssValue); return cssValue; } return null; } else { if (value != null && value.length() > 0) { cssValue.setValue(value); return cssValue; } else { this.remove(cssValue); return null; } } }
public List<CssValue> readCssValues(Map<String,String> propertyMap) { if (propertyMap == null || propertyMap.isEmpty()) { return new ArrayList<>(); } return propertyMap.entrySet().stream() .filter(entry -> CssProperty.get(entry.getKey()) != null) .map(entry -> new CssValue(entry.getKey(), entry.getValue())) .collect(Collectors.toList()); }
protected void applyCssToElement(Map<String,String> properties, IsWidget element) { if (properties != null && !properties.isEmpty()) { final Style style = element.asWidget().getElement().getStyle(); cssPropertiesHelper.readCssValues(properties) .stream().forEach(cssValue -> { String prop = cssValue.getPropertyInCamelCase(); String val = cssValue.getValue(); style.setProperty(prop, val); }); } } }
public CssValue getValue(CssProperty property) { for (CssValue cssValue : this) { if (cssValue.getProperty().equals(property.getName())) { return cssValue; } } return null; }
public CssValue setValue(CssProperty property, String value) { CssValue cssValue = getValue(property); if (cssValue == null) { if (value != null && value.length() > 0) { cssValue = new CssValue(property.getName(), value); this.add(cssValue); return cssValue; } return null; } else { if (value != null && value.length() > 0) { cssValue.setValue(value); return cssValue; } else { this.remove(cssValue); return null; } } }
public List<CssValue> readCssValues(Map<String,String> propertyMap) { if (propertyMap == null || propertyMap.isEmpty()) { return new ArrayList<>(); } return propertyMap.entrySet().stream() .filter(entry -> CssProperty.get(entry.getKey()) != null) .map(entry -> new CssValue(entry.getKey(), entry.getValue())) .collect(Collectors.toList()); }
public String toString() { StringBuffer out = new StringBuffer(selector); out.append(" {\n"); this.forEach(v -> out.append(" ").append(v.getProperty()).append(":").append(v.getValue()).append(";\n")); out.append("}"); return out.toString(); } }
public String toString() { StringBuffer out = new StringBuffer(selector); out.append(" {\n"); this.forEach(v -> out.append(" ").append(v.getProperty()).append(":").append(v.getValue()).append(";\n")); out.append("}"); return out.toString(); } }
public String formatValues() { StringBuilder out = new StringBuilder(); forEach(item -> out.append(item.getProperty()).append(":").append(item.getValue()).append(";")); return out.toString(); }
protected void applyCssToElement(Map<String,String> properties, HTMLElement element) { if (properties != null && !properties.isEmpty()) { CSSStyleDeclaration style = element.getStyle(); cssPropertiesHelper.readCssValues(properties) .stream().forEach(cssValue -> { String prop = cssValue.getProperty(); String val = cssValue.getValue(); style.setProperty(prop, val); }); } }
protected void applyCssToElement(Map<String,String> properties, HTMLElement element) { if (properties != null && !properties.isEmpty()) { CSSStyleDeclaration style = element.getStyle(); cssPropertiesHelper.readCssValues(properties) .stream().forEach(cssValue -> { String prop = cssValue.getProperty(); String val = cssValue.getValue(); style.setProperty(prop, val); }); } }
protected void applyCssProperties(HTMLElement widget) { List<CssValue> cssValues = layoutCssHelper.readCssValues(layoutComponent.getProperties()); cssValues.forEach(cssValue -> { String prop = cssValue.getProperty(); String val = cssValue.getValue(); widget.getStyle().setProperty(prop, val); }); } }
@Override public void applyCssValues(List<CssValue> cssValues) { layout.getStyle().setCssText(""); cssValues.forEach(cssValue -> { String prop = cssValue.getProperty(); String val = cssValue.getValue(); layout.getStyle().setProperty(prop, val); }); } }
protected void applyCssProperties(HTMLElement widget) { List<CssValue> cssValues = layoutCssHelper.readCssValues(layoutComponent.getProperties()); cssValues.forEach(cssValue -> { String prop = cssValue.getProperty(); String val = cssValue.getValue(); widget.getStyle().setProperty(prop, val); }); } }
@Override public void applyCssValues(List<CssValue> cssValues) { mainRow.getStyle().setCssText(""); cssValues.forEach(cssValue -> { String prop = cssValue.getProperty(); String val = cssValue.getValue(); mainRow.getStyle().setProperty(prop, val); }); }