Package com.volantis.styling.values

Examples of com.volantis.styling.values.MutablePropertyValues


        TestDeviceLayoutContext deviceContext = new TestDeviceLayoutContext();
        deviceContext.setFormatInstance(pane, NDimensionalIndex.ZERO_DIMENSIONS,
                paneInstance);
        pageContext.pushDeviceLayoutContext(deviceContext);

        MutablePropertyValues properties = createPropertyValues();
        StyleColor value =
            styleValueFactory.getColorByPercentages(null, 50, 50, 50);
        properties.setComputedValue(StylePropertyDetails.BACKGROUND_COLOR,
                value);
        properties.setComputedValue(StylePropertyDetails.TEXT_ALIGN,
                TextAlignKeywords.CENTER);

        // Open the containing <td> element which will receive the width and
        // align attributes.
        buffer.openStyledElement("td", attributes);
View Full Code Here


        ContextInternals.setMarinerPageContext(requestContext, context);
        context.pushRequestContext(requestContext);

        context.setDeviceName("Master");
        protocol.setMarinerPageContext(context);
        MutablePropertyValues properties = createPropertyValues();

        Element element = domFactory.createElement();
        ColumnIteratorPaneAttributes attrs =
                new ColumnIteratorPaneAttributes();
        Pane pane = new Pane(new CanvasLayout());
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

            Styles afterStyles =
                    shortcutStyles.findNestedStyles(PseudoElements.AFTER);

            if (afterStyles != null) {

                MutablePropertyValues propertyValues =
                        afterStyles.getPropertyValues();
                StyleList content = (StyleList) propertyValues.
                        getComputedValue(StylePropertyDetails.CONTENT);

                // if we have a specified seperator then create a ShortcutProperties
                // object and configure it.
                ShortcutProperties shortcutProps = new ShortcutProperties();
View Full Code Here

     * @param type   The menu type, which may be null
     */
    private void useDeprecatedMenuTypes(
            Styles styles, String type) throws PAPIException {
        // Get the mutable style property values object
        MutablePropertyValues properties = styles.getPropertyValues();

        // If the deprecated type tag has been used, need to mirror its
        // meaning using the menu style properties
        if (type != null & type != "") {
            // Handle the type accordingly
            if (type.equals(OLD_TYPE_PLAINTEXT) ||
                    type.equals(OLD_TYPE_ROLLOVERTEXT)) {
                properties.setComputedValue(
                        StylePropertyDetails.MCS_MENU_IMAGE_STYLE,
                        MCSMenuImageStyleKeywords.NONE);
                properties.setComputedValue(
                        StylePropertyDetails.MCS_MENU_TEXT_STYLE,
                        MCSMenuTextStyleKeywords.PLAIN);
            } else if (type.equals(OLD_TYPE_ROLLOVERIMAGE)) {
                properties.setComputedValue(
                        StylePropertyDetails.MCS_MENU_IMAGE_STYLE,
                        MCSMenuImageStyleKeywords.ROLLOVER);
                properties.setComputedValue(
                        StylePropertyDetails.MCS_MENU_TEXT_STYLE,
                        MCSMenuTextStyleKeywords.NONE);
            } else {
                // This state should not happen as the type (if it exists)
                // should only be one of the above.
View Full Code Here

     * initialise the state of the emulator using a given set of attributes
     * @param hrAttrs
     */
    protected void initialiseState(HorizontalRuleAttributes hrAttrs) {

        MutablePropertyValues propertyValues =
                hrAttrs.getStyles().getPropertyValues();

        //read the style values from the hr attributes
        width = propertyValues
                .getComputedValue(StylePropertyDetails.WIDTH);

        if (propertyValues.wasExplicitlySpecified(StylePropertyDetails.TEXT_ALIGN)) {
            align = propertyValues
                    .getComputedValue(StylePropertyDetails.TEXT_ALIGN);

        } else {
            align = TextAlignKeywords.CENTER;
        }

        height = propertyValues
                .getComputedValue(StylePropertyDetails.HEIGHT);

        color = propertyValues
                .getComputedValue(StylePropertyDetails.COLOR);

        //set the default for any value not found
        if (width == WidthKeywords.AUTO) {
            width = STYLE_PERCENTAGE_100;
View Full Code Here

     *
     * @param element the element containing the style.
     */
    protected void removeListStylePosition(final Element element) {
        Styles styles = element.getStyles();
        MutablePropertyValues propertyValues = styles.getPropertyValues();
        propertyValues.markAsUnspecified(
                StylePropertyDetails.LIST_STYLE_POSITION);
    }
View Full Code Here

    private Element createMarkerElement(DOMFactory domFactory, Styles markerStyles) {

        Element markerSpan = domFactory.createElement(SPAN);
        markerSpan.setStyles(markerStyles);

        MutablePropertyValues propertyValues =
                markerStyles.getPropertyValues();
        StyleValue content =
                propertyValues.getComputedValue(StylePropertyDetails.CONTENT);
        if (content != null) {
            Inserter inserter = getInserter();
            inserter.insert(markerSpan, content);

            propertyValues.clearPropertyValue(StylePropertyDetails.CONTENT);

            // As some content has been added to the marker make sure that
            // if the user has not explicitly specified any padding on the
            // right that we add some to make it readable.
            propertyValues.overrideUnlessExplicitlySpecified(
                    StylePropertyDetails.PADDING_RIGHT, DEFAULT_PADDING__RIGHT);

        } // otherwise don't use a marker

        return markerSpan;
View Full Code Here

            markerStyles = stylingFactory.createInheritedStyles(
                    styles, DisplayKeywords.TABLE_CELL);
        }

        markerTd.setStyles(markerStyles);
        MutablePropertyValues propertyValues =
                markerStyles.getPropertyValues();
        StyleValue content = propertyValues.getComputedValue(
                StylePropertyDetails.CONTENT);

        // Make sure that the display is set correctly on the td.
        propertyValues.setComputedValue(StylePropertyDetails.DISPLAY,
                DisplayKeywords.TABLE_CELL);

        if (content != ContentKeywords.NORMAL &&
                content != ContentKeywords.NONE) {

            // Make sure that the marker is at the top of the table cell
            // and aligned to the right unless it has been explicitly
            // specified to be elsewhere.
            overrideVerticalAlign(propertyValues);
            overrideTextAlign(propertyValues);

            Inserter inserter = getInserter();
            inserter.insert(markerTd, content);
            propertyValues.clearPropertyValue(StylePropertyDetails.CONTENT);
        }
    }
View Full Code Here

        Element contentTd = domFactory.createElement(TD);

        // todo don't use this as it does not handle styles from default.css properly.
        Styles styles = stylingFactory.createInheritedStyles(tr.getStyles(),
                DisplayKeywords.TABLE_CELL);
        MutablePropertyValues propertyValues = styles.getPropertyValues();

        // Make sure that the content is at the top of the table cell unless
        // it has been explicitly specified to be elsewhere.
        overrideVerticalAlign(propertyValues);
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.