Package org.w3c.css.sac

Examples of org.w3c.css.sac.SelectorList


    public void setSelectorText(String selectorText) throws DOMException {
  try {
      InputSource is = new InputSource(new StringReader(selectorText));
      parser.setSelectorFactory(SELECTOR_FACTORY);
      parser.setConditionFactory(CONDITION_FACTORY);
      SelectorList sl = selectors;
      selectors = parser.parseSelectors(is);
      if (styleRuleChangeSupport != null) {
    styleRuleChangeSupport.fireSelectorListChange(sl, selectors);
      }
  } catch (Exception e) {
View Full Code Here


    protected class StyleRuleHandler extends DocumentHandlerAdapter {
  /**
   * Receives notification of the beginning of a rule statement.
   */
  public void startSelector(SelectorList selectors) throws CSSException {
      SelectorList sl = CSSOMStyleRule.this.selectors;
      CSSOMStyleRule.this.selectors = selectors;
      if (styleRuleChangeSupport != null) {
    styleRuleChangeSupport.fireSelectorListChange(sl, selectors);
      }
  }
View Full Code Here

     * @param isLocal
     */
    protected void addStyleRule(StyleRule rule, MediaList mediaList, boolean isLocal)
    {
        // for each selector in this rule
        SelectorList selectors = rule.getSelectorList();
        int nSelectors = selectors.getLength();
        for (int i = 0; i < nSelectors; i++)
        {
            Selector selector = selectors.item(i);
            StyleDeclaration declaration = rule.getStyleDeclaration();

            // If we have a list of selectors, copy the shared
            // StyleDeclaration so that we can independently track
            // subject and selectors per instance.
View Full Code Here

      for (int i = 0; i < list.getLength(); i++) {
        CSSRule rule = list.item(i);
        if (rule instanceof CSSStyleRule) {
          CSSStyleRule styleRule = (CSSStyleRule) rule;
          String selector = styleRule.getSelectorText();
          SelectorList selectors = parser.parseSelectors(new InputSource(new StringReader(selector)));
          for (int j = 0; j < selectors.getLength(); j++) {
            Selector sel = selectors.item(j);
            if (sel instanceof ConditionalSelector) {
              Condition cond = ((ConditionalSelector) sel).getCondition();
              SimpleSelector simple = ((ConditionalSelector) sel).getSimpleSelector();

              if (simple instanceof ElementSelector) {
View Full Code Here

    final Parser parser = CSSParserFactory.getInstance().createCSSParser();
    final StyleSheetHandler handler = new StyleSheetHandler();
    handler.init (resourceManager, null, 0, StyleKeyRegistry.getRegistry(), null);
    parser.setDocumentHandler(handler);
    final String selector = ".bordered";
    final SelectorList sl =
            parser.parseSelectors(new StringInputSource (selector, new URL("http://localhost")));
    System.exit(0);
  }
View Full Code Here

        handler.initParseContext(source);
        handler.setStyleRule(new CSSStyleRule(null, null));
        parser.setDocumentHandler(handler);

        final SelectorList selectorList = parser.parseSelectors(source);
        CSSParserContext.getContext().destroy();
        return selectorList;
      }
    }
    catch (Exception e)
View Full Code Here

        handler.initParseContext(source);
        handler.setStyleRule(new CSSStyleRule(null, null));
        parser.setDocumentHandler(handler);

        final SelectorList selectorList = parser.parseSelectors(source);
        CSSParserContext.getContext().destroy();
        return selectorList;
      }
    }
    catch (Exception e)
View Full Code Here

    final Parser parser = CSSParserFactory.getInstance().createCSSParser();
    final StyleSheetHandler handler = new StyleSheetHandler();
    handler.init (resourceManager, null, 0, StyleKeyRegistry.getRegistry(), null);
    parser.setDocumentHandler(handler);
    SelectorList sl =
            parser.parseSelectors(new StringInputSource (selector, new URL("http://localhost")));
    System.exit(0);
  }
View Full Code Here

/**
* @exception ParseException exception during the parse
*/
  final public void styleRule() throws ParseException {
    boolean start = false;
    SelectorList l = null;
    Token save;
    Locator loc;
    try {
      l = selectorList();
                        save = token;
View Full Code Here

      }
    }
  }

  final public SelectorList _parseSelectors() throws ParseException {
  SelectorList p = null;
    try {
      label_75:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
View Full Code Here

TOP

Related Classes of org.w3c.css.sac.SelectorList

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.