Package com.volantis.mcs.dom2theme.impl.optimizer

Examples of com.volantis.mcs.dom2theme.impl.optimizer.BasicShorthandAnalyzer


                BorderWidthKeywords.MEDIUM, BorderWidthKeywords.MEDIUM,
                BorderWidthKeywords.MEDIUM, BorderWidthKeywords.MEDIUM,
                PropertyStatus.CLEARABLE, PropertyStatus.CLEARABLE,
                PropertyStatus.CLEARABLE, PropertyStatus.CLEARABLE);

        BasicShorthandAnalyzer analyzer = new BasicShorthandAnalyzer(
                StyleShorthands.BORDER_WIDTH, checkerMock, shorthandSetMock);
        analyzer.analyze(TargetEntity.ELEMENT, inputValues, deviceValuesMock);

        assertFalse("Shouldn't be able to use shorthand",
                analyzer.canUseShorthand());
        assertTrue("Should be able to clear all", analyzer.allClearable());
        assertEquals("Should all be initial", 4, analyzer.getInitialCount());
        assertEquals("Should be normal priority",
                Priority.NORMAL, analyzer.getShorthandPriority());
    }
View Full Code Here


                OptimizerHelper.ANY, OptimizerHelper.ANY,
                OptimizerHelper.ANY, OptimizerHelper.ANY,
                PropertyStatus.REQUIRED, PropertyStatus.REQUIRED,
                PropertyStatus.REQUIRED, PropertyStatus.REQUIRED);

        BasicShorthandAnalyzer analyzer = new BasicShorthandAnalyzer(
                StyleShorthands.BORDER_WIDTH, checkerMock, shorthandSetMock);
        analyzer.analyze(TargetEntity.ELEMENT, inputValues, deviceValuesMock);

        assertTrue("Should be able to use shorthand",
                analyzer.canUseShorthand());
        assertFalse("Should not be able to clear all", analyzer.allClearable());
        assertEquals("None should be initial", 0, analyzer.getInitialCount());
        assertEquals("Should be normal priority",
                Priority.NORMAL, analyzer.getShorthandPriority());
    }
View Full Code Here

     */
    public FontAnalyzer(
            PropertyClearerChecker checker, ShorthandSet supportedShorthands) {
        super(PropertyGroups.FONT_PROPERTIES);

        systemAnalyzer = new BasicShorthandAnalyzer(StyleShorthands.FONT,
                new StyleProperty[]{StylePropertyDetails.MCS_SYSTEM_FONT},
                checker, supportedShorthands);
        standardAnalyzer = new FontShorthandAnalyzer(checker,
                supportedShorthands);

View Full Code Here

        length = EDGE_SHORTHANDS.length;
        edgeAnalyzers = new ShorthandAnalyzer[length];
        for (int i = 0; i < length; i++) {
            StyleShorthand shorthand = EDGE_SHORTHANDS[i];
            edgeAnalyzers[i] = new BasicShorthandAnalyzer(shorthand, checker,
                    supportedShorthands);
        }

        characteristics = new StyleValue[CHARACTERISTIC_COUNT];
    }
View Full Code Here

                PropertyStatus.REQUIRED);

        MutableStyleProperties outputValues =
            ThemeFactory.getDefaultInstance().createMutableStyleProperties();

        ShorthandAnalyzer analyzer = new BasicShorthandAnalyzer(
                StyleShorthands.BORDER_LEFT, checkerMock, shorthandSetMock);
        analyzer.analyze(TargetEntity.ELEMENT, inputValues, deviceValuesMock);
        analyzer.updateShorthand(outputValues);

        assertTrue("Should be able to use shorthand",
                analyzer.canUseShorthand());

        // red should be the color overide
        // none was specified
        // initial value was got for width as style is none
        assertEquals("Shorthand should match:",
View Full Code Here

                PropertyStatus.REQUIRED);

        MutableStyleProperties outputValues =
            ThemeFactory.getDefaultInstance().createMutableStyleProperties();

        ShorthandAnalyzer analyzer = new BasicShorthandAnalyzer(
                StyleShorthands.BORDER_LEFT, checkerMock, shorthandSetMock);
        analyzer.analyze(TargetEntity.ELEMENT, inputValues, deviceValuesMock);

        assertTrue("Should be able to use shorthand",
                analyzer.canUseShorthand());

        analyzer.updateShorthand(outputValues);

        assertEquals("Shorthand should match:",
                "border-left:red dashed thick !important",
                outputValues.getShorthandValue(
                StyleShorthands.BORDER_LEFT).getStandardCSS());
View Full Code Here

TOP

Related Classes of com.volantis.mcs.dom2theme.impl.optimizer.BasicShorthandAnalyzer

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.