use of org.w3c.dom.css.CSSStyleDeclaration in project kie-wb-common by kiegroup.
the class SVGStyleTranslator method parseElementStyleDefinition.
private static StyleDefinition parseElementStyleDefinition(final String styleRaw) throws TranslatorException {
final CSSStyleSheetImpl sheet = parseElementStyleSheet(styleRaw);
final CSSRuleList cssRules = sheet.getCssRules();
for (int i = 0; i < cssRules.getLength(); i++) {
final CSSRule item = cssRules.item(i);
if (CSSRule.STYLE_RULE == item.getType()) {
final CSSStyleRuleImpl rule = (CSSStyleRuleImpl) item;
final CSSStyleDeclaration declaration = rule.getStyle();
return parseStyleDefinition(declaration);
}
}
return null;
}
use of org.w3c.dom.css.CSSStyleDeclaration in project dbeaver by serge-rider.
the class E4ThemeColor method getCssValueFromTheme.
public static String getCssValueFromTheme(Display display, String value) {
// use reflection so that this can build against Eclipse 3.x
BundleContext context = FrameworkUtil.getBundle(E4ThemeColor.class).getBundleContext();
ServiceReference<IThemeManager> reference = context.getServiceReference(IThemeManager.class);
if (reference != null) {
IThemeManager iThemeManager = context.getService(reference);
if (iThemeManager != null) {
IThemeEngine themeEngine = iThemeManager.getEngineForDisplay(display);
if (themeEngine != null) {
CSSStyleDeclaration shellStyle = getStyleDeclaration(themeEngine, display);
if (shellStyle != null) {
CSSValue cssValue = shellStyle.getPropertyCSSValue(value);
if (cssValue != null) {
return cssValue.getCssText();
}
}
}
}
}
return null;
}
use of org.w3c.dom.css.CSSStyleDeclaration in project dbeaver by dbeaver.
the class E4ThemeColor method getCssValueFromTheme.
public static String getCssValueFromTheme(Display display, String value) {
// use reflection so that this can build against Eclipse 3.x
BundleContext context = FrameworkUtil.getBundle(E4ThemeColor.class).getBundleContext();
ServiceReference<IThemeManager> reference = context.getServiceReference(IThemeManager.class);
if (reference != null) {
IThemeManager iThemeManager = context.getService(reference);
if (iThemeManager != null) {
IThemeEngine themeEngine = iThemeManager.getEngineForDisplay(display);
if (themeEngine != null) {
CSSStyleDeclaration shellStyle = getStyleDeclaration(themeEngine, display);
if (shellStyle != null) {
CSSValue cssValue = shellStyle.getPropertyCSSValue(value);
if (cssValue != null) {
return cssValue.getCssText();
}
}
}
}
}
return null;
}
Aggregations