Package org.w3c.dom.stylesheets

Examples of org.w3c.dom.stylesheets.StyleSheet


        NodeList nl = getElementsByTagName("style");
        Vector shs = new Vector();
        for (int count = 0; count < nl.getLength(); count++) {
            Node el = (Node) nl.item(count);
            SVGStyleElementImpl sse = (SVGStyleElementImpl) el;
            StyleSheet sheet = sse.getStyleSheet();
            shs.addElement(sheet);
        }
        return new StyleSheetListImpl(shs);
    }
View Full Code Here


    /**
     * An auxiliary method for getStyleSheets.
     */
    protected static void getStyleSheets(Node n, DOMStyleSheetList l) {
        if (n instanceof LinkStyle) {
            StyleSheet ss = ((LinkStyle)n).getSheet();
            if (ss != null) {
                l.append(ss);
            }
        }
        for (Node c = n.getFirstChild(); c != null; c = c.getNextSibling()) {
View Full Code Here

     * Enables the alternate stylesheet with the given title.
     */
    public void enableAlternateStyleSheet(String title) {
        getStyleSheets();
        for (int i = 0; i < styleSheets.getLength(); i++) {
            StyleSheet ss = (StyleSheet)styleSheets.item(i);
            Node on = ss.getOwnerNode();
            if (on instanceof SVGStyleSheetProcessingInstruction) {
                SVGStyleSheetProcessingInstruction sspi;
                sspi = (SVGStyleSheetProcessingInstruction)on;
                if ("yes".equals(sspi.getPseudoAttributes().get("alternate"))) {
                    ss.setDisabled(!title.equals(ss.getTitle()));
                }
            }
        }
    }
View Full Code Here

    // {
    // // loop for styles (<style> and <link>)
    // org.w3c.dom.stylesheets.StyleSheet ss = ssl.item(i);
    if (styleSheets != null) {
      for (int i = 0, numStyles = styleSheets.size(); i < numStyles; i++) {
        StyleSheet ss = (StyleSheet) styleSheets.get(i);
        try {
          query.apply((ICSSNode) ss);
        } catch (ClassCastException ex) {
          Logger log = PDPlugin.getLogger(CSSStyleDeclaration.class);
          log.error("Error.CSSUtil.0", ex); //$NON-NLS-1$
View Full Code Here

    List validAdapters = getValidAdapters();

    if (index < 0 || index >= validAdapters.size())
      return null;
    StyleSheet sheet = ((IStyleSheetAdapter) validAdapters.get(index)).getSheet();
    if (sheet == null) {// for LINK element whose link is broken
      ICSSModel model = ((AbstractStyleSheetAdapter) validAdapters.get(index)).createModel();
      sheet = ((model != null) ? (StyleSheet) model.getDocument() : null);
    }
    return sheet;
View Full Code Here

      if (IHTMLConstants.TAG_LINK.equalsIgnoreCase(tagName)
          || IHTMLConstants.TAG_STYLE.equalsIgnoreCase(tagName)) {
        INodeAdapter adapter = notifier
            .getAdapterFor(IStyleSheetAdapter.class);
        if (adapter instanceof IStyleSheetAdapter) {
          StyleSheet sheet = ((IStyleSheetAdapter) adapter).getSheet();
                    if (sheet != null)
                    {
                        result.add(sheet);
                    }
        }
View Full Code Here

    /**
     * An auxiliary method for getStyleSheets.
     */
    protected static void getStyleSheets(Node n, DOMStyleSheetList l) {
        if (n instanceof LinkStyle) {
            StyleSheet ss = ((LinkStyle)n).getSheet();
            if (ss != null) {
                l.append(ss);
            }
        }
        for (Node c = n.getFirstChild(); c != null; c = c.getNextSibling()) {
View Full Code Here

     * Enables the alternate stylesheet with the given title.
     */
    public void enableAlternateStyleSheet(String title) {
        getStyleSheets();
        for (int i = 0; i < styleSheets.getLength(); i++) {
            StyleSheet ss = (StyleSheet)styleSheets.item(i);
            Node on = ss.getOwnerNode();
            if (on instanceof SVGStyleSheetProcessingInstruction) {
                SVGStyleSheetProcessingInstruction sspi;
                sspi = (SVGStyleSheetProcessingInstruction)on;
                if ("yes".equals(sspi.getPseudoAttributes().get("alternate"))) {
                    ss.setDisabled(!title.equals(ss.getTitle()));
                }
            }
        }
    }
View Full Code Here

        NodeList nl = getElementsByTagName("style");
        Vector shs = new Vector();
        for (int count = 0; count < nl.getLength(); count++) {
            Node el = (Node) nl.item(count);
            SVGStyleElementImpl sse = (SVGStyleElementImpl) el;
            StyleSheet sheet = sse.getStyleSheet();
            shs.addElement(sheet);
        }
        return new StyleSheetListImpl(shs);
    }
View Full Code Here

    /**
     * An auxiliary method for getStyleSheets.
     */
    protected static void getStyleSheets(Node n, DOMStyleSheetList l) {
        if (n instanceof LinkStyle) {
            StyleSheet ss = ((LinkStyle)n).getSheet();
            if (ss != null) {
                l.append(ss);
            }
        }
        for (Node c = n.getFirstChild(); c != null; c = c.getNextSibling()) {
View Full Code Here

TOP

Related Classes of org.w3c.dom.stylesheets.StyleSheet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.