Examples of SelectorFactoryImpl


Examples of org.w3c.flute.parser.selectors.SelectorFactoryImpl

            throws CSSException, IOException {
        this.source = source;
        ReInit(getCharStreamWithLurk(source));

        if (selectorFactory == null) {
            selectorFactory = new SelectorFactoryImpl();
        }
        if (conditionFactory == null) {
            conditionFactory = new ConditionFactoryImpl();
        }
        _parseImportRule();
View Full Code Here

Examples of org.w3c.flute.parser.selectors.SelectorFactoryImpl

            throws CSSException, IOException {
        this.source = source;
        ReInit(getCharStreamWithLurk(source));

        if (selectorFactory == null) {
            selectorFactory = new SelectorFactoryImpl();
        }
        if (conditionFactory == null) {
            conditionFactory = new ConditionFactoryImpl();
        }
        _parseMediaRule();
View Full Code Here

Examples of org.w3c.flute.parser.selectors.SelectorFactoryImpl

            throws CSSException, IOException {
        this.source = source;
        ReInit(getCharStreamWithLurk(source));

        if (selectorFactory == null) {
            selectorFactory = new SelectorFactoryImpl();
        }
        if (conditionFactory == null) {
            conditionFactory = new ConditionFactoryImpl();
        }
        return _parseSelectors();
View Full Code Here

Examples of org.w3c.flute.parser.selectors.SelectorFactoryImpl

            throws CSSException, IOException {
        this.source = source;
        ReInit(getCharStreamWithLurk(source));

        if (selectorFactory == null) {
            selectorFactory = new SelectorFactoryImpl();
        }
        if (conditionFactory == null) {
            conditionFactory = new ConditionFactoryImpl();
        }
        return _parseNamespaceToken();
View Full Code Here

Examples of org.w3c.flute.parser.selectors.SelectorFactoryImpl

            Selector selector, String toBeReplacedSelectorName,
            SimpleSelector candidateSelector) {
        if (!toString(selector).contains(toBeReplacedSelectorName)) {
            return selector;
        }
        SelectorFactory factory = new SelectorFactoryImpl();
        if (selector instanceof SimpleSelector) {
            return createSimpleSelectorWithSomePartReplaced(
                    (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) {
            CompositeSelector compositeSelector = (CompositeSelector) selector;
            Selector first = compositeSelector.getFirst();
View Full Code Here

Examples of org.w3c.flute.parser.selectors.SelectorFactoryImpl

        if (oldConditionSelector == null
                || !toString(oldConditionSelector).contains(
                        toBeReplacedSelectorName)) {
            return oldConditionSelector;
        }
        SelectorFactory selectorFactory = new SelectorFactoryImpl();
        if (candidateSelector instanceof ElementSelector) {
            return selectorFactory.createConditionalSelector(candidateSelector,
                    oldConditionSelector.getCondition());
        }
        if (candidateSelector instanceof ConditionalSelector) {
            // TODO some cases not covered.
            ConditionalSelector candidateConditionSelector = (ConditionalSelector) candidateSelector;
            Condition newCondition = createConditionWithSomePartReplaced(
                    oldConditionSelector.getCondition(),
                    toBeReplacedSelectorName,
                    candidateConditionSelector.getCondition());
            return selectorFactory.createConditionalSelector(
                    oldConditionSelector.getSimpleSelector(), newCondition);
        }
        return oldConditionSelector;
    }
View Full Code Here

Examples of org.w3c.flute.parser.selectors.SelectorFactoryImpl

    }

    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) {
            return factory.createConditionalSelector(es,
                    ((ConditionalSelector) selector).getCondition());
        } else if (selector instanceof DescendantSelector) {
            return factory.createDescendantSelector(es,
                    ((DescendantSelector) selector).getSimpleSelector());
        } else if (selector instanceof ChildSelectorImpl) {
            return factory.createChildSelector(es,
                    ((DescendantSelector) selector).getSimpleSelector());
        } else {
            throw new Exception("Invalid selector type");
        }
    }
View Full Code Here

Examples of org.w3c.flute.parser.selectors.SelectorFactoryImpl

    public void parseStyleSheet(InputSource source)
            throws CSSException, IOException {
        this.source = source;
        ReInit(getCharStreamWithLurk(source));
        if (selectorFactory == null) {
            selectorFactory = new SelectorFactoryImpl();
        }
        if (conditionFactory == null) {
            conditionFactory = new ConditionFactoryImpl();
        }
View Full Code Here

Examples of org.w3c.flute.parser.selectors.SelectorFactoryImpl

            throws CSSException, IOException {
        this.source = source;
        ReInit(getCharStreamWithLurk(source));

        if (selectorFactory == null) {
            selectorFactory = new SelectorFactoryImpl();
        }
        if (conditionFactory == null) {
            conditionFactory = new ConditionFactoryImpl();
        }
        _parseRule();
View Full Code Here

Examples of org.w3c.flute.parser.selectors.SelectorFactoryImpl

            throws CSSException, IOException {
        this.source = source;
        ReInit(getCharStreamWithLurk(source));

        if (selectorFactory == null) {
            selectorFactory = new SelectorFactoryImpl();
        }
        if (conditionFactory == null) {
            conditionFactory = new ConditionFactoryImpl();
        }
        _parseDeclarationBlock();
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.