Package org.w3c.css.sac

Examples of org.w3c.css.sac.SimpleSelector


                    (SimpleSelector) selector, toBeReplacedSelectorName,
                    candidateSelector);
        } else if (selector instanceof DescendantSelector) {
            DescendantSelector descendantSelector = (DescendantSelector) selector;
            Selector ancestor = descendantSelector.getAncestorSelector();
            SimpleSelector simpleSelector = descendantSelector
                    .getSimpleSelector();
            return factory.createDescendantSelector(
                    createSelectorWithSomePartReplaced(ancestor,
                            toBeReplacedSelectorName, candidateSelector),
                    createSimpleSelectorWithSomePartReplaced(simpleSelector,
                            toBeReplacedSelectorName, candidateSelector));
        } else if (selector instanceof DirectAdjacentSelectorImpl) {
            SiblingSelector siblingSelector = (SiblingSelector) selector;
            Selector ancestor = siblingSelector.getSelector();
            SimpleSelector simpleSelector = siblingSelector
                    .getSiblingSelector();
            return factory.createDirectAdjacentSelector(
                    Selector.SAC_DIRECT_ADJACENT_SELECTOR, ancestor,
                    simpleSelector);
        } else if (selector instanceof CompositeSelector) {
View Full Code Here


        }
        // Conditional Selector
        else if (selector instanceof ConditionalSelector)
        {
            ConditionalSelector conditionalSelector = (ConditionalSelector)selector;
            SimpleSelector simpleSelector = conditionalSelector.getSimpleSelector();
            if (simpleSelector instanceof ElementSelector)
            {
                simpleTypeSelector = convertTypeSelector((ElementSelector)simpleSelector, declaration);
            }

            if (simpleTypeSelector != null)
            {
                Condition condition = conditionalSelector.getCondition();
                boolean supportedCondition = convertCondition(simpleTypeSelector, condition);
                if (!supportedCondition)
                {
                    int lineNumber = getSelectorLineNumber(selector, declaration);
                    String path = getPathForReporting(declaration);
                    unsupportedCondition(condition, path, lineNumber);
                    return null;
                }
            }
            else
            {
                int lineNumber = getSelectorLineNumber(selector, declaration);
                String path = getPathForReporting(declaration);
                unsupportedSelector(selector, path, lineNumber);
            }
        }
        // Descendant Selector
        else if (selector instanceof DescendantSelector)
        {
            DescendantSelector descendantSelector = (DescendantSelector)selector;
            SimpleSelector simpleSelector = descendantSelector.getSimpleSelector();

            // We may have conditions too, so we call convertSelector().
            simpleTypeSelector = convertSelector(simpleSelector, declaration);
            if (simpleTypeSelector != null)
            {
View Full Code Here

          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) {
                String tagName = ((ElementSelector) simple).getLocalName();
                if (tagName == null) {
                  tagName = "*";
 
View Full Code Here

      if (ObjectUtilities.equal(ac.getValue(), pseudo) == false)
      {
        continue;
      }

      final SimpleSelector simpleSelector = cs.getSimpleSelector();
      if (isMatch(element, simpleSelector))
      {
        return true;
      }
    }
View Full Code Here

      if (ObjectUtilities.equal(ac.getValue(), pseudo) == false)
      {
        continue;
      }

      final SimpleSelector simpleSelector = cs.getSimpleSelector();
      if (isMatch(element, simpleSelector))
      {
        return true;
      }
    }
View Full Code Here

/**
* @exception ParseException exception during the parse
*/
  final public Selector simple_selector(Selector selector, char comb) throws ParseException {
    SimpleSelector simple_current = null;
    Condition cond = null;

    pseudoElt = null;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case ANY:
View Full Code Here

/**
* @exception ParseException exception during the parse
*/
  final public Selector simple_selector(Selector selector, char comb) throws ParseException {
    SimpleSelector simple_current = null;
    Condition cond = null;

    pseudoElt = null;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case ANY:
View Full Code Here

    /**
     * Parses a simple selector.
     */
    protected SimpleSelector parseSimpleSelector() {
        SimpleSelector result;

        String uri = defaultNamespace;
        int currentLineNumber = getLineNumber();

        switch (current) {
View Full Code Here

    /**
     * Parses a selector.
     */
    protected Selector parseSelector() {
        SimpleSelector ss = parseSimpleSelector();
        Selector result = ss;

        pseudoElement = null;

        loop: for (;;) {
View Full Code Here

    /**
     * Parses a simple selector.
     */
    protected SimpleSelector parseSimpleSelector() {
        SimpleSelector result;

        switch (current) {
        case LexicalUnits.IDENTIFIER:
            result = selectorFactory.createElementSelector
                (null, scanner.getStringValue());
View Full Code Here

TOP

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

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.