Examples of ElementSelector


Examples of org.w3c.css.sac.ElementSelector

          return valueOf(s.getAncestorSelector()) + " "
              + valueOf(s.getSimpleSelector());
      }

    } else if (selector instanceof ElementSelector) {
      ElementSelector s = (ElementSelector) selector;
      if (s.getLocalName() == null) {
        return "*";
      } else {
        return escapeIdent(s.getLocalName());
      }

    } else if (selector instanceof NegativeSelector) {
      // Unimplemented in CSS2?

    } else if (selector instanceof ProcessingInstructionSelector) {
      // Unimplemented in CSS2?

    } else if (selector instanceof SiblingSelector) {
      SiblingSelector s = (SiblingSelector) selector;
      return valueOf(s.getSelector()) + "+" + valueOf(s.getSiblingSelector());
    }

    throw new RuntimeException("Unhandled selector of type "
        + selector.getClass().getName());
  }
View Full Code Here

Examples of org.w3c.css.sac.ElementSelector

        final LayoutContext layoutContext = node.getLayoutContext();
        return layoutContext.isPseudoElement();
      }
      case Selector.SAC_ELEMENT_NODE_SELECTOR:
      {
        final ElementSelector es = (ElementSelector) selector;
        final LayoutContext layoutContext = node.getLayoutContext();
        final String localName = es.getLocalName();
        if (localName != null)
        {
          if (localName.equals(layoutContext.getTagName()) == false)
          {
            return false;
          }
        }
        final String namespaceURI = es.getNamespaceURI();
        if (namespaceURI != null)
        {
          if (namespaceURI.equals(layoutContext.getNamespace()) == false)
          {
            return false;
View Full Code Here

Examples of org.w3c.css.sac.ElementSelector

          return valueOf(s.getAncestorSelector()) + " "
              + valueOf(s.getSimpleSelector());
      }

    } else if (selector instanceof ElementSelector) {
      ElementSelector s = (ElementSelector) selector;
      if (s.getLocalName() == null) {
        return "*";
      } else {
        return escapeIdent(s.getLocalName());
      }

    } else if (selector instanceof NegativeSelector) {
      // Unimplemented in CSS2?

    } else if (selector instanceof ProcessingInstructionSelector) {
      // Unimplemented in CSS2?

    } else if (selector instanceof SiblingSelector) {
      SiblingSelector s = (SiblingSelector) selector;
      return valueOf(s.getSelector()) + "+" + valueOf(s.getSiblingSelector());
    }

    throw new RuntimeException("Unhandled selector of type "
        + selector.getClass().getName());
  }
View Full Code Here

Examples of org.w3c.css.sac.ElementSelector

    public static Selector createSelectorAndreplaceSelectorVariableWithValue(
            Selector selector, String variable, String value) throws Exception {

        SelectorFactoryImpl factory = new SelectorFactoryImpl();

        ElementSelector es = factory.createElementSelector(
                null,
                ((ElementSelector) selector).getLocalName().replaceAll(
                        variable, value));

        if (selector instanceof ConditionalSelector) {
View Full Code Here

Examples of org.w3c.css.sac.ElementSelector

          return valueOf(s.getAncestorSelector()) + " "
              + valueOf(s.getSimpleSelector());
      }

    } else if (selector instanceof ElementSelector) {
      ElementSelector s = (ElementSelector) selector;
      if (s.getLocalName() == null) {
        return "*";
      } else {
        return escapeIdent(s.getLocalName());
      }

    } else if (selector instanceof NegativeSelector) {
      // Unimplemented in CSS2?

    } else if (selector instanceof ProcessingInstructionSelector) {
      // Unimplemented in CSS2?

    } else if (selector instanceof SiblingSelector) {
      SiblingSelector s = (SiblingSelector) selector;
      return valueOf(s.getSelector()) + "+" + valueOf(s.getSiblingSelector());
    }

    throw new RuntimeException("Unhandled selector of type "
        + selector.getClass().getName());
  }
View Full Code Here

Examples of org.w3c.css.sac.ElementSelector

        final LayoutContext layoutContext = node.getLayoutContext();
        return layoutContext.isPseudoElement();
      }
      case Selector.SAC_ELEMENT_NODE_SELECTOR:
      {
        final ElementSelector es = (ElementSelector) selector;
        final LayoutContext layoutContext = node.getLayoutContext();
        final String localName = es.getLocalName();
        if (localName != null)
        {
          if (localName.equals(layoutContext.getTagName()) == false)
          {
            return false;
          }
        }
        final String namespaceURI = es.getNamespaceURI();
        if (namespaceURI != null)
        {
          if (namespaceURI.equals(layoutContext.getNamespace()) == false)
          {
            return false;
View Full Code Here

Examples of org.w3c.css.sac.ElementSelector

        final LayoutContext layoutContext = node.getLayoutContext();
        return layoutContext.isPseudoElement();
      }
      case Selector.SAC_ELEMENT_NODE_SELECTOR:
      {
        final ElementSelector es = (ElementSelector) selector;
        final LayoutContext layoutContext = node.getLayoutContext();
        final String localName = es.getLocalName();
        if (localName != null)
        {
          if (localName.equals(layoutContext.getTagName()) == false)
          {
            return false;
          }
        }
        String namespaceURI = es.getNamespaceURI();
        if (namespaceURI != null)
        {
          if (namespaceURI.equals(layoutContext.getNamespace()) == false)
          {
            return false;
View Full Code Here

Examples of org.w3c.css.sac.ElementSelector

          return valueOf(s.getAncestorSelector()) + " "
              + valueOf(s.getSimpleSelector());
      }

    } else if (selector instanceof ElementSelector) {
      ElementSelector s = (ElementSelector) selector;
      if (s.getLocalName() == null) {
        return "*";
      } else {
        return escapeIdent(s.getLocalName());
      }

    } else if (selector instanceof NegativeSelector) {
      // Unimplemented in CSS2?

    } else if (selector instanceof ProcessingInstructionSelector) {
      // Unimplemented in CSS2?

    } else if (selector instanceof SiblingSelector) {
      SiblingSelector s = (SiblingSelector) selector;
      return valueOf(s.getSelector()) + "+" + valueOf(s.getSiblingSelector());
    }

    throw new RuntimeException("Unhandled selector of type "
        + selector.getClass().getName());
  }
View Full Code Here

Examples of org.w3c.css.sac.ElementSelector

            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());
            }
            else
            {
               write(" ");
               write(simpleSel);
            }
            break;
         }
         case Selector.SAC_ELEMENT_NODE_SELECTOR : {
            ElementSelector elementSel = (ElementSelector)sel;

            //
            if (elementSel.getLocalName() == null)
            {
               // Universal element selector * that we can omit
            }
            else
            {
               write(elementSel.getLocalName());
            }
            break;
         }
         default :
            throw new UnsupportedOperationException("Selector type = " + sel.getSelectorType() + " with class "
View Full Code Here

Examples of org.w3c.css.sac.ElementSelector

         return new ConditionalSelectorObject(conditional.getSelectorType(), (SimpleSelectorObject)create(conditional
            .getSimpleSelector()), ConditionObject.create(conditional.getCondition()));
      }
      else if (selector instanceof ElementSelector)
      {
         ElementSelector element = (ElementSelector)selector;
         return new ElementSelectorObject(element.getSelectorType(), element.getNamespaceURI(), element.getLocalName());
      }
      else if (selector instanceof DescendantSelector)
      {
         DescendantSelector descendant = (DescendantSelector)selector;
         SimpleSelectorObject simple = (SimpleSelectorObject)create(descendant.getSimpleSelector());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.