/** * Creates a new NodeAttributesModel object. */ public NodeCSSValuesModel(Node n) { node = n; if (viewCSS != null) { style = viewCSS.getComputedStyle((Element)n, null); propertyNames = new ArrayList(); if (style != null) { for (int i = 0; i < style.getLength(); i++) { propertyNames.add(style.item(i)); } Collections.sort(propertyNames); } } }
/** * Creates a new NodeAttributesModel object. */ public NodeCSSValuesModel(Node n) { node = n; if (viewCSS != null) { style = viewCSS.getComputedStyle((Element)n, null); propertyNames = new ArrayList(); if (style != null) { for (int i = 0; i < style.getLength(); i++) { propertyNames.add(style.item(i)); } Collections.sort(propertyNames); } } }
/** * <b>DOM</b>: Implements {@link * org.w3c.dom.css.ViewCSS#getComputedStyle(Element,String)}. */ public CSSStyleDeclaration getComputedStyle(Element elt, String pseudoElt) { AbstractView av = ((DocumentView)getOwnerDocument()).getDefaultView(); return ((ViewCSS)av).getComputedStyle(elt, pseudoElt); }
/** * <b>DOM</b>: Implements {@link * org.w3c.dom.css.ViewCSS#getComputedStyle(Element,String)}. */ public CSSStyleDeclaration getComputedStyle(Element elt, String pseudoElt) { AbstractView av = ((DocumentView)getOwnerDocument()).getDefaultView(); return ((ViewCSS)av).getComputedStyle(elt, pseudoElt); }
/** * <b>DOM</b>: Implements {@link * org.w3c.dom.css.ViewCSS#getComputedStyle(Element,String)}. */ public CSSStyleDeclaration getComputedStyle(Element elt, String pseudoElt) { AbstractView av = ((DocumentView)getOwnerDocument()).getDefaultView(); return ((ViewCSS)av).getComputedStyle(elt, pseudoElt); }
@Override public CSSStyleDeclaration getStyle(Object widget) { for (CSSEngine engine : cssEngines) { CSSElementContext context = engine.getCSSElementContext(widget); if (context != null) { Element e = context.getElement(); if (e != null) { return engine.getViewCSS().getComputedStyle(e, null); } } } return null; }
public CSSStyleDeclaration getStyle(Object widget) { for (CSSEngine engine : cssEngines) { CSSElementContext context = engine.getCSSElementContext(widget); if (context != null) { Element e = context.getElement(); if (e != null) { return engine.getViewCSS().getComputedStyle(e, null); } } } return null; }
/** * Applies the style declaration for selected items to the specified * item if one has been defined. * * @param selection * the item to style */ private boolean styleSelected(Item selection) { CSSStyleDeclaration selectedStyle = engine.getViewCSS() .getComputedStyle(engine.getElement(selection), "selected"); if (selectedStyle == null) { return false; } applyStyles(selectedStyle, "selected", selection); return true; }
/** * Applies the style declaration for selected items to the specified * item if one has been defined. * * @param selection * the item to style */ private boolean styleSelected(Item selection) { CSSStyleDeclaration selectedStyle = engine.getViewCSS() .getComputedStyle(engine.getElement(selection), "selected"); if (selectedStyle == null) { return false; } applyStyles(selectedStyle, "selected", selection); return true; }
/** * Applies the regular unselected styles to the specified items. * * @param items * the items to style */ private void styleUnselected(Item[] items) { for (int i = 0; i < items.length; i++) { CSSStyleDeclaration unselectedStyle = engine.getViewCSS() .getComputedStyle(engine.getElement(items[i]), null); if (unselectedStyle == null) { // no styles defined, just reset the font setFont(items[i], null); } else { applyStyles(unselectedStyle, null, items[i]); } } }
/** * Applies the regular unselected styles to the specified items. * * @param items * the items to style */ private void styleUnselected(Item[] items) { for (Item item : items) { CSSStyleDeclaration unselectedStyle = engine.getViewCSS() .getComputedStyle(engine.getElement(item), null); if (unselectedStyle == null) { // no styles defined, just reset the font setFont(item, null); } else { applyStyles(unselectedStyle, null, item); } } }
CSSStyleDeclaration style = viewCSS.getComputedStyle(elt, null); if (computeDefaultStyle) { if (applyStylesToChildNodes) String pseudoInstance = pseudoInstances[i]; CSSStyleDeclaration styleWithPseudoInstance = viewCSS .getComputedStyle(elt, pseudoInstance); if (computeDefaultStyle) {
.getComputedStyle(engine.getElement(selection), "selected"); if (selectedStyle != null) { .getComputedStyle(engine.getElement(selection), null); if (unselectedStyle == null) {
.getComputedStyle(engine.getElement(selection), "selected"); if (selectedStyle != null) { .getComputedStyle(engine.getElement(selection), null); if (unselectedStyle == null) {