Package org.eclipse.wst.css.core.internal.util

Examples of org.eclipse.wst.css.core.internal.util.CSSClassTraverser


      IStyleSheetListAdapter adapter = (IStyleSheetListAdapter) ((INodeNotifier) doc)
          .getAdapterFor(IStyleSheetListAdapter.class);
      StyleSheetList ssl = (adapter == null ? null : adapter
          .getStyleSheets());

      CSSClassTraverser traverser = new CSSClassTraverser();
      if (ssl != null) {
        for (int i = 0, numStyles = ssl.getLength(); i < numStyles; i++) {
          // loop for styles (<style> and <link>)
          org.w3c.dom.stylesheets.StyleSheet ss = ssl.item(i);

          try {
            traverser.apply((ICSSNode) ss);
          } catch (ClassCastException ex) {
            Logger log = PDPlugin
                .getLogger(CSSStyleDeclaration.class);
            log.error("Error.CSSUtil.0", ex); //$NON-NLS-1$
            // FIXME: should this continue to be processed?
          }
        }
        c = traverser.getClassNames();
      }
    }
    String[] result = new String[c.size()];
    c.toArray(result);
    return result;
View Full Code Here


    StyleSheetList sheetList = getStyleSheets();
    int nSheets = sheetList.getLength();

    final ArrayList classes = new ArrayList();

    CSSClassTraverser traverser = new CSSClassTraverser();
    traverser.setTraverseImported(true);

    for (int i = 0; i < nSheets; i++) {
      org.w3c.dom.stylesheets.StyleSheet sheet = sheetList.item(i);
      if (sheet instanceof ICSSNode) {
        traverser.apply((ICSSNode) sheet);
      }
    }
    classes.addAll(traverser.getClassNames());

    return new Enumeration() {
      int i = 0;

      public boolean hasMoreElements() {
View Full Code Here

      IStyleSheetListAdapter adapter = (IStyleSheetListAdapter) ((INodeNotifier) doc)
          .getAdapterFor(IStyleSheetListAdapter.class);
      StyleSheetList ssl = (adapter == null ? null : adapter
          .getStyleSheets());

      CSSClassTraverser traverser = new CSSClassTraverser();
      if (ssl != null) {
        for (int i = 0, numStyles = ssl.getLength(); i < numStyles; i++) {
          // loop for styles (<style> and <link>)
          org.w3c.dom.stylesheets.StyleSheet ss = ssl.item(i);

          try {
            traverser.apply((ICSSNode) ss);
          } catch (ClassCastException ex) {
            JSFCorePlugin.log(ex, "Unable to cast to CSS style"); //$NON-NLS-1$
          }
        }
        c = traverser.getClassNames();
      }
    }
    String[] result = new String[c.size()];
    c.toArray(result);
    return result;
View Full Code Here

TOP

Related Classes of org.eclipse.wst.css.core.internal.util.CSSClassTraverser

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.