Package com.volantis.styling

Examples of com.volantis.styling.StatefulPseudoClassSet


            PropertyValueArray array = null;
            for (int i = 0; i < nestedStyles.length; i++) {
                DeviceStylesImpl deviceStyles =  nestedStyles[i];
                PseudoStyleEntity entity = deviceStyles.pseudoStyleEntity;
                if (entity instanceof StatefulPseudoClassSet) {
                    StatefulPseudoClassSet other =
                            (StatefulPseudoClassSet) entity;
                    if (other.isSubSetOf(pseudoClasses)) {
                        if (array == null) {
                            array = new SparsePropertyValueArray();
                        }
                        DeviceValuesImpl values = (DeviceValuesImpl)
                                deviceStyles.values;
View Full Code Here


                deviceStyles = deviceStyles.getNestedStyles(pseudoElement);
                valid = true;
            }

        } else if (entity instanceof StatefulPseudoClassSet) {
            StatefulPseudoClassSet pseudoClassSet =
                    (StatefulPseudoClassSet) entity;
            if (pseudoClassSet.isSubSetOf(VALID_PSEUDO_CLASSES)) {
                pseudoStylePath =
                        pseudoStylePath.addPseudoClassSet(pseudoClassSet);
                deviceStyles = deviceStyles.getMatchingStyles(pseudoClassSet);
                valid = true;
            }
View Full Code Here

            // 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 =
                            (StatefulPseudoClassSet) previous;
                    pseudoStyleEntities.remove(length - 1);
                    classSet = previousPseudoClassSet.combine(classSet);
                }
            }

            // Add the pseudo class set to the end of the list of pseudo style
            // entities.
View Full Code Here

        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(
//                "visited", expectations);
//
//        StatefulPseudoClassMock hoverVisitedMock = new StatefulPseudoClassMock(
//                "hover:visited", expectations);

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

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

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

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

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

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

        List selectors = new ArrayList();
        PseudoClassSelector themeSelector =
                themeModelFactory.createPseudoClassSelector("hover");
        selectors.add(themeSelector);
        themeSelector = themeModelFactory.createPseudoClassSelector("visited");
        selectors.add(themeSelector);
        SelectorSequence sequence = createSelectorSequence(selectors);

        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", hoverVisited, actual);
    }
View Full Code Here

TOP

Related Classes of com.volantis.styling.StatefulPseudoClassSet

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.