Package com.volantis.styling

Examples of com.volantis.styling.StatefulPseudoClass


        // Update the specificity.
        specificityCalculator.addPseudoClassSelector();

        String pseudoClassName = selector.getPseudoClassType().getType();

        StatefulPseudoClass pseudoClass = null;
        if (pseudoStyleEntityProvider != null) {
            pseudoClass = pseudoStyleEntityProvider.getStatefulPseudoClass(
                    pseudoClassName);
        }

        if (pseudoClass != null) {

            // Stateful pseudo class. Merge consecutive stateful pseudo classes
            // together.

            // If the last item in the list of pseudo style entities is a
            // PseudoClassSet then remove it, and merge with the current
            // class set.
            final int length = pseudoStyleEntities.size();
            StatefulPseudoClassSet classSet = pseudoClass.getSet();
            if (length > 0) {
                PseudoStyleEntity previous = (PseudoStyleEntity)
                        pseudoStyleEntities.get(length - 1);
                if (previous instanceof StatefulPseudoClassSet) {
                    StatefulPseudoClassSet previousPseudoClassSet =
View Full Code Here


        // =====================================================================
        //   Create Mocks
        // =====================================================================

        StatefulPseudoClass hover = StatefulPseudoClasses.HOVER;

        // =====================================================================
        //   Set Expectations
        // =====================================================================

        pseudoEntityProviderMock.expects.getStatefulPseudoClass("hover").returns(hover);

        factoryMock.expects.createUniversalMatcher().returns(universalMock);

        // Set the expectations on the specificity calculator.
        specificityCalculatorMock.expects.addPseudoClassSelector();

        // =====================================================================
        //   Test Expectations
        // =====================================================================

        PseudoClassSelector themeSelector =
                themeModelFactory.createPseudoClassSelector("hover");
        SelectorSequence sequence = createSelectorSequence(themeSelector);

        MatcherBuilder builder = createMatcherBuilder();
        Matcher matcher = builder.getMatcher(sequence);

        assertSame("Constructed matcher not as expected",
                   universalMock, matcher);
        List entities = builder.getPseudoStyleEntities();
        assertEquals("List should contain one item", 1, entities.size());
        StatefulPseudoClassSet actual = (StatefulPseudoClassSet) entities.get(0);
        assertEquals("Pseudo class set not as expected", hover.getSet(), actual);
    }
View Full Code Here

        // =====================================================================
        //   Create Mocks
        // =====================================================================

        StatefulPseudoClass hover = StatefulPseudoClasses.HOVER;
        StatefulPseudoClass visited = StatefulPseudoClasses.VISITED;
        StatefulPseudoClassSet hoverVisited = hover.getSet().add(visited);
//        StatefulPseudoClassMock hoverMock = new StatefulPseudoClassMock(
//                "hover", expectations);
//
//        StatefulPseudoClassMock visitedMock = new StatefulPseudoClassMock(
View Full Code Here

        assertEquals("pulsate", extractor.getEffectStyle());
    }

    public void testNestedStylesWithoutBaseWithoutNestedValue()
            throws Exception {
        StatefulPseudoClass pseudoClass = StatefulPseudoClasses.MCS_CONCEALED;
        StylesMock styles = buildStyles(
                StylePropertyDetails.MCS_EFFECT_STYLE, null,
                pseudoClass, null);
        StylesExtractor extractor = new StylesExtractor(styles, pseudoClass);
View Full Code Here

        assertEquals("none", extractor.getEffectStyle());
    }

    public void testNestedStylesWithoutBaseWithNestedValue() throws Exception {
        StatefulPseudoClass pseudoClass = StatefulPseudoClasses.MCS_CONCEALED;
        StylesMock styles = buildStyles(
                StylePropertyDetails.MCS_EFFECT_STYLE, null,
                pseudoClass, MCSEffectStyleKeywords.PULSATE);
        StylesExtractor extractor = new StylesExtractor(styles, pseudoClass);
View Full Code Here

        assertEquals("pulsate", extractor.getEffectStyle());
    }

    public void testNestedStylesWithBaseWithoutNestedValue() throws Exception {
        StatefulPseudoClass pseudoClass = StatefulPseudoClasses.MCS_CONCEALED;
        StylesMock styles = buildStyles(
                StylePropertyDetails.MCS_EFFECT_STYLE, MCSEffectStyleKeywords.PULSATE,
                pseudoClass, null);
        StylesExtractor extractor = new StylesExtractor(styles, pseudoClass);
        // base styles should propagate to nested styles
View Full Code Here

        // base styles should propagate to nested styles
        assertEquals("pulsate", extractor.getEffectStyle());
    }

    public void testNestedStylesWithBaseWithNestedValue() throws Exception {
        StatefulPseudoClass pseudoClass = StatefulPseudoClasses.MCS_CONCEALED;
        StylesMock styles = buildStyles(
                StylePropertyDetails.MCS_EFFECT_STYLE, MCSEffectStyleKeywords.PUFF,
                pseudoClass, MCSEffectStyleKeywords.PULSATE);
        StylesExtractor extractor = new StylesExtractor(styles, pseudoClass);
View Full Code Here

TOP

Related Classes of com.volantis.styling.StatefulPseudoClass

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.