Package com.volantis.styling.values

Examples of com.volantis.styling.values.MutablePropertyValues


    }

    protected void checkNormalized(
            ImmutableStylePropertySet supportedProperties, String expectedCSS) {

        final MutablePropertyValues filteredValues =
                STYLING_FACTORY.createPropertyValues();
        supportedProperties.iterateStyleProperties(new StylePropertyIteratee() {
            public IterationAction next(StyleProperty property) {
                filteredValues.setComputedValue(property,
                        inputValues.getStyleValue(property));
                return IterationAction.CONTINUE;
            }
        });

        assertEquals(expectedCSS, filteredValues.getStandardCSS());
    }
View Full Code Here


            StylingFactory stylingFactory = StylingFactory.getDefaultInstance();

            final MutableStyleProperties inputProperties =
                    parser.parseDeclarations(inputCSS);
            final MutablePropertyValues inputValues = stylingFactory.createPropertyValues(
                    StylePropertyDetails.getDefinitions());
            inputProperties.iteratePropertyValues(new PropertyValueIteratee() {
                public IterationAction next(PropertyValue propertyValue) {
                    inputValues.setComputedValue(propertyValue.getProperty(),
                            propertyValue.getValue());
                    return IterationAction.CONTINUE;
                }
            });
View Full Code Here

        //   Test Expectations
        // =====================================================================
        InputPropertiesOptimizer optimizer = new PropertiesOptimizer(detailsSet,
                extractorContextMock, shorthandSetMock);

        MutablePropertyValues values =
                STYLING_FACTORY.createPropertyValues();
        values.setComputedValue(StylePropertyDetails.BORDER_COLLAPSE,
                BorderCollapseKeywords.SEPARATE);

        MutableStyleProperties properties = optimizer.calculateOutputProperties(
                "a", PseudoStylePath.EMPTY_PATH,
                values, parentProperties, deviceValuesMock);
View Full Code Here

        //   Test Expectations
        // =====================================================================
        InputPropertiesOptimizer optimizer = new PropertiesOptimizer(detailsSet,
                extractorContextMock, shorthandSetMock);

        MutablePropertyValues values = STYLING_FACTORY.createPropertyValues();
        values.setComputedValue(StylePropertyDetails.BORDER_COLLAPSE,
                BorderCollapseKeywords.SEPARATE);

        MutableStyleProperties properties = optimizer.calculateOutputProperties(
                "a", PseudoStylePath.EMPTY_PATH,
                values, parentProperties, deviceValuesMock);
View Full Code Here

        //   Test Expectations
        // =====================================================================
        InputPropertiesOptimizer optimizer = new PropertiesOptimizer(detailsSet,
                extractorContextMock, shorthandSetMock);

        MutablePropertyValues values = STYLING_FACTORY.createPropertyValues();
        values.setComputedValue(StylePropertyDetails.COLOR,
                StyleColorNames.RED);
        values.setComputedValue(StylePropertyDetails.BACKGROUND_COLOR,
                StyleColorNames.RED);

        MutableStyleProperties properties = optimizer.calculateOutputProperties(
                "a", PseudoStylePath.EMPTY_PATH,
                values, parentProperties, deviceValuesMock);
View Full Code Here

        //   Test Expectations
        // =====================================================================
        InputPropertiesOptimizer optimizer = new PropertiesOptimizer(detailsSet,
                extractorContextMock, shorthandSetMock);

        MutablePropertyValues values = STYLING_FACTORY.createPropertyValues();
        values.setComputedValue(StylePropertyDetails.CONTENT,
            StyleValueFactory.getDefaultInstance().getList(
                Collections.singletonList(
                    StyleValueFactory.getDefaultInstance().getString(
                        null, "content"))));
        values.setComputedValue(StylePropertyDetails.COLOR,
                StyleColorNames.RED);

        MutableStyleProperties properties = optimizer.calculateOutputProperties(
                "a", PseudoStylePath.EMPTY_PATH,
                values, parentProperties, deviceValuesMock);
View Full Code Here

        //   Test Expectations
        // =====================================================================
        InputPropertiesOptimizer optimizer = new PropertiesOptimizer(detailsSet,
                extractorContextMock, shorthandSetMock);

        MutablePropertyValues values = STYLING_FACTORY.createPropertyValues();
        values.setComputedValue(StylePropertyDetails.BORDER_TOP_COLOR,
                StyleColorNames.RED);
        values.setComputedValue(StylePropertyDetails.BORDER_TOP_STYLE,
                BorderStyleKeywords.NONE);
        values.setComputedValue(StylePropertyDetails.BORDER_TOP_WIDTH,
                BorderWidthKeywords.THICK);

        MutableStyleProperties properties = optimizer.calculateOutputProperties(
                "a", PseudoStylePath.EMPTY_PATH,
                values, parentProperties, deviceValuesMock);
View Full Code Here

        if (!interestingProperties.contains(property)) {
            return false;
        }
        if (onlyExplicitlySpecified) {
            MutablePropertyValues extended =
                    values;
            if (!extended.wasExplicitlySpecified(property)) {
                return false;
            }
        }

        return true;
View Full Code Here

        DoSelectInputTestHelper helper = new DoSelectInputTestHelper();

        XFSelectAttributes atts = helper.buildSelectAttributes();
        Styles styles = atts.getStyles();
        MutablePropertyValues propertyValues = styles.getPropertyValues();

        if(!multiSelect) {
            for(int i=0; i<selectedOtions.length; i++) {
                if(selectedOtions[i]) {
                    atts.setInitial("Value" + (i+1));
                    break;
                }
            }
        }

        atts.setMultiple(multiSelect);
        //atts.setTabindex(tabIndex);
        // add some options
        helper.addOption(atts, "Caption1", "Prompt1", "Value1",
                          selectedOtions[0]);
        helper.addOption(atts, "Caption2", "Prompt2", "Value2",
                          selectedOtions[1]);


        SelectOptionGroup group = null;
        String caption, prompt;
        int count = 0;
        do {
            caption = "Group" + (count + 1);
            prompt = "Prompt" + (count + 1);
            if(0 == count) {
                group = helper.addOptionGroup(atts, caption, prompt);;
            } else {
                group = helper.addOptionGroup(group, caption, prompt);
            }
        } while(++count < optGroupCount);


        helper.addOption(group, "Caption3", "Prompt3", "Value3",
                          selectedOtions[2]);

        //protocol.addStyleMapping(atts, style);
        TestDOMOutputBuffer buffer = new TestDOMOutputBuffer();

        propertyValues.setComputedValue(
                StylePropertyDetails.MCS_SELECTION_LIST_STYLE,
                MCSSelectionListStyleKeywords.CONTROLS);
        propertyValues.setComputedValue(
                StylePropertyDetails.MCS_SELECTION_LIST_OPTION_LAYOUT,
                rightAlignCaption ? MCSSelectionListOptionLayoutKeywords.CONTROL_FIRST
                : MCSSelectionListOptionLayoutKeywords.CAPTION_FIRST);
        propertyValues.setComputedValue(
                StylePropertyDetails.MCS_MENU_ORIENTATION,
                vertical ? MCSMenuOrientationKeywords.VERTICAL
                : MCSMenuOrientationKeywords.HORIZONTAL);

        TestMarinerPageContext testPageContext =
View Full Code Here

        privateSetUp();
        final DoSelectInputTestHelper helper = new DoSelectInputTestHelper();

        final XFSelectAttributes attributes = helper.buildSelectAttributes();
        Styles styles = attributes.getStyles();
        MutablePropertyValues propertyValues = styles.getPropertyValues();
        attributes.setMultiple(false);

        // add some optionsDOMP
        helper.addOption(attributes, "Caption1", "Prompt1", "Value1", true);
        helper.addOption(attributes, "Caption2", "Prompt2", "Value2", false);
        final Styles captionStyles =
                StylesBuilder.getCompleteStyles("font-weight: bold");
        ((SelectOption) attributes.getOptions().get(0)).setCaptionStyles(captionStyles);

        // create style
        propertyValues.setComputedValue(
                StylePropertyDetails.MCS_SELECTION_LIST_STYLE,
                MCSSelectionListStyleKeywords.CONTROLS);
        propertyValues.setComputedValue(
                StylePropertyDetails.MCS_SELECTION_LIST_OPTION_LAYOUT,
                MCSSelectionListOptionLayoutKeywords.CONTROL_FIRST);
        propertyValues.setComputedValue(
                StylePropertyDetails.MCS_MENU_ORIENTATION,
                MCSMenuOrientationKeywords.VERTICAL);

        // initialise the buffer
        final TestDOMOutputBuffer buffer = new TestDOMOutputBuffer();
View Full Code Here

TOP

Related Classes of com.volantis.styling.values.MutablePropertyValues

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.