/* * (non-Javadoc) * * @see org.eclipse.e4.ui.css.core.dom.properties.providers. * AbstractCSSPropertyHandlerProvider * #getDefaultCSSStyleDeclaration(org.eclipse * .e4.ui.css.core.engine.CSSEngine, * org.eclipse.e4.ui.css.core.dom.CSSStylableElement, * org.w3c.dom.css.CSSStyleDeclaration) */ protected CSSStyleDeclaration getDefaultCSSStyleDeclaration( CSSEngine engine, CSSStylableElement stylableElement, CSSStyleDeclaration newStyle, String pseudoE) throws Exception { if (stylableElement.getDefaultStyleDeclaration(pseudoE) != null) return stylableElement.getDefaultStyleDeclaration(pseudoE); if (newStyle != null) { StringBuffer style = null; int length = newStyle.getLength(); for (int i = 0; i < length; i++) { String propertyName = newStyle.item(i); String[] compositePropertiesNames = engine.getCSSCompositePropertiesNames(propertyName); if (compositePropertiesNames != null) { for (int j = 0; j < compositePropertiesNames.length; j++) { propertyName = compositePropertiesNames[j]; String s = getCSSPropertyStyle(engine, stylableElement, propertyName, pseudoE); if (s != null) { if (style == null) style = new StringBuffer(); style.append(s); } } } else { String s = getCSSPropertyStyle(engine, stylableElement, propertyName, pseudoE); if (s != null) { if (style == null) style = new StringBuffer(); style.append(s); } } } if (style != null) { CSSStyleDeclaration defaultStyleDeclaration = engine.parseStyleDeclaration(style.toString()); stylableElement.setDefaultStyleDeclaration(pseudoE, defaultStyleDeclaration); return defaultStyleDeclaration; } } return stylableElement.getDefaultStyleDeclaration(pseudoE); }