Package org.w3c.css.sac

Examples of org.w3c.css.sac.SimpleSelector


      switch (sel.getSelectorType())
      {
         case Selector.SAC_CONDITIONAL_SELECTOR : {
            ConditionalSelector conditionalSel = (ConditionalSelector)sel;
            Condition condition = conditionalSel.getCondition();
            SimpleSelector simpleSel = conditionalSel.getSimpleSelector();
            write(simpleSel);
            write(condition);
            break;
         }
         case Selector.SAC_CHILD_SELECTOR : {
            DescendantSelector childSel = (DescendantSelector)sel;
            Selector ancestorSel = childSel.getAncestorSelector();
            SimpleSelector simpleSel = childSel.getSimpleSelector();

            //
            if (simpleSel.getSelectorType() == Selector.SAC_PSEUDO_ELEMENT_SELECTOR)
            {
               ElementSelector elementSel = (ElementSelector)simpleSel;
               write(ancestorSel);
               write(":");
               write(elementSel.getLocalName());
            }
            else
            {
               write(ancestorSel);
               write(">");
               write(simpleSel);
            }
            break;
         }
         case Selector.SAC_DESCENDANT_SELECTOR : {
            DescendantSelector descendantSel = (DescendantSelector)sel;
            SimpleSelector simpleSel = descendantSel.getSimpleSelector();
            write(descendantSel.getAncestorSelector());

            //
            if (simpleSel.getSelectorType() == Selector.SAC_PSEUDO_ELEMENT_SELECTOR)
            {
               ElementSelector pseudoElementSel = (ElementSelector)simpleSel;
               write(":");
               write(pseudoElementSel.getLocalName());
            }
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.currentValue());
View Full Code Here

    /**
     * Returns a representation of the selector.
     */
    public String toString() {
  SimpleSelector s = getSimpleSelector();
  if (s.getSelectorType() == SAC_PSEUDO_ELEMENT_SELECTOR) {
      return "" + getAncestorSelector() + s;
  }
  return getAncestorSelector() + " > " + s;
    }
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

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

        switch (current) {
        case LexicalUnits.IDENTIFIER:
            result = selectorFactory.createElementSelector
                (null, scanner.getStringValue());
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

    /**
     * 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;

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

        switch (current) {
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.