Package com.volantis.styling.values

Examples of com.volantis.styling.values.PropertyValues


        Map params = null;

        boolean post = false;

        Styles styles = attributes.getStyles();
        PropertyValues propertyValues = styles.getPropertyValues();
        StyleValue styleValue;

        styleValue = propertyValues.getComputedValue(
                StylePropertyDetails.MCS_HTTP_METHOD_HINT);
        if (styleValue == MCSHttpMethodHintKeywords.POST) {
            post = true;

            if (href != null) {
View Full Code Here


        // Only do the align code for the first row.
        // Allow for the row to be zero as there may not have been a tr
        if (ts.getRow() <= 1) {
            Styles styles = attributes.getStyles();
            PropertyValues propertyValues = styles.getPropertyValues();
            StyleValue styleValue = propertyValues.getComputedValue(
                    StylePropertyDetails.TEXT_ALIGN);

            ReusableStringBuffer tableAlign = ts.getBuffer();
            if (styleValue == TextAlignKeywords.RIGHT) {
                tableAlign.append('R');
View Full Code Here

        element.setAttribute("name", attributes.getName());
        element.setAttribute("type", attributes.getType().toLowerCase());

        // Get stylistic information.
        Styles styles = attributes.getStyles();
        PropertyValues propertyValues = styles.getPropertyValues();

        StyleInteger columnsValue = (StyleInteger)
                propertyValues.getComputedValue(StylePropertyDetails.MCS_COLUMNS);
        element.setAttribute("size", columnsValue.getStandardCSS());

        addTextInputValidation(element, attributes);

        if ((value = getInitialValue(attributes)) != null) {
View Full Code Here

    private void addGridAttributes(Element element,
                                     MCSAttributes attributes,
                                     Format format) {

        Styles styles = attributes.getStyles();
        PropertyValues propertyValues = styles.getPropertyValues();

        StyleValue value = propertyValues.getComputedValue(
                    StylePropertyDetails.BACKGROUND_COLOR);
        StyleValue align = propertyValues.getComputedValue(
                    StylePropertyDetails.TEXT_ALIGN);

        addColourAttribute(element,
                           value,
                           getFormatName(format, attributes),
                           VDXMLConstants.BACKGROUND_COLOUR_ATTRIBUTE,
                           true);

        // Padding is the same all the way round so arbitrarily use the top
        value = propertyValues.getComputedValue(
                StylePropertyDetails.PADDING_TOP);
        if (value != null) {
            element.setAttribute(
                    VDXMLConstants.PSEUDO_PADDING_ATTRIBUTE,
                    convertToCharCount(value));
        }

        value = propertyValues.getComputedValue(
                StylePropertyDetails.BORDER_SPACING);
        if (value != null) {
            element.setAttribute(
                    VDXMLConstants.PSEUDO_SPACING_ATTRIBUTE,
                    convertToCharCount(value));
View Full Code Here

                                   MCSAttributes attributes) {
        Element helpElement = dom.openElement(VDXMLConstants.HELP_ELEMENT);

        // Inherit the colours from the help zone pane
        Styles styles = attributes.getStyles();
        PropertyValues propertyValues = styles.getPropertyValues();

        addColourAttribute(helpElement,
                propertyValues.getComputedValue(
                        StylePropertyDetails.BACKGROUND_COLOR),
                VDXMLConstants.HELP_ELEMENT,
                VDXMLConstants.BACKGROUND_COLOUR_ATTRIBUTE);
        addColourAttribute(helpElement,
                propertyValues.getComputedValue(StylePropertyDetails.COLOR),
                VDXMLConstants.HELP_ELEMENT,
                VDXMLConstants.TEXT_COLOUR_ATTRIBUTE);

        // Add the prompt message, styled differently if attributes != null
        if (attributes != null) {
View Full Code Here

    private void setPaneAttributes(Pane pane,
                                   Element element,
                                   MCSAttributes attributes) {
        final String destinationArea = pane.getDestinationArea();
        Styles styles = attributes.getStyles();
        PropertyValues propertyValues = styles.getPropertyValues();

        // Handle dimensions first
        // Themes don't override pane widths and heights
        String width = calculatePaneWidth(pane, propertyValues, element);
        String height = calculatePaneHeight(pane, propertyValues, element);
        String borderWidth = convertToCharCount(propertyValues.getComputedValue(
                StylePropertyDetails.BORDER_TOP_WIDTH));

        element.setAttribute(VDXMLConstants.WIDTH_ATTRIBUTE, width);
        element.setAttribute(VDXMLConstants.HEIGHT_ATTRIBUTE, height);

        if (destinationArea != null) {
            element.setAttribute(
                    VDXMLConstants.PSEUDO_DESTINATION_AREA_ATTRIBUTE,
                    destinationArea);

            if ((NAVIGATION_DESTINATION.equals(destinationArea)) &&
                    (helpZonePane != null)) {
                element.setAttribute(
                        VDXMLConstants.PSEUDO_HAS_HELP_ZONE_ATTRIBUTE,
                        "true");
            }
        }

        if (borderWidth != null) {
            element.setAttribute(VDXMLConstants.PSEUDO_BORDER_ATTRIBUTE,
                                 borderWidth);
            addColourAttribute(
                    element, propertyValues.getComputedValue(
                                StylePropertyDetails.BORDER_TOP_COLOR),
                        getFormatName(pane, attributes),
                        VDXMLConstants.PSEUDO_BORDER_COLOUR_ATTRIBUTE);
            }

        // The help zone "pane" doesn't want any further style attributes and
        // doesn't define a "display context" (so don't store the style
        // properties)
        if (pane != helpZonePane) {
                addColourAttribute(element,propertyValues.getComputedValue(
                        StylePropertyDetails.COLOR),
                        getFormatName(pane, attributes),
                        VDXMLConstants.TEXT_COLOUR_ATTRIBUTE);

            addGridAttributes(element, attributes, pane);
View Full Code Here

    private void addLengthAttribute(
            Element element, Styles styles,
            final StyleProperty property,
            final String attributeName) {

        PropertyValues propertyValues = styles.getPropertyValues();
        StyleValue styleValue = propertyValues.getComputedValue(property);
        if (styleValue instanceof StyleLength) {
            StyleLength length = (StyleLength) styleValue;
            if (length.getUnit() == LengthUnit.PX) {
                int value = (int) length.getNumber();
                element.setAttribute(attributeName, convertToCharCount(value));
View Full Code Here

                                      String elementName) {
        // Needed to set up the colours using the theme
        Styles styles = attributes.getStyles();

        if (styles != null) {
            PropertyValues propertyValues = styles.getPropertyValues();
            if (propertyValues != null) {
                // Style/theme exists to copy attributes from, so do so!
                addColourAttribute(element,
                        propertyValues.getComputedValue(
                                StylePropertyDetails.COLOR),
                        elementName,
                        VDXMLConstants.TEXT_COLOUR_ATTRIBUTE);

                addColourAttribute(element,
                        propertyValues.getComputedValue(
                                StylePropertyDetails.BACKGROUND_COLOR),
                        elementName,
                        VDXMLConstants.BACKGROUND_COLOUR_ATTRIBUTE);
            }
        }
View Full Code Here

            protocol.setCanvasAttributes(pattributes);

            // Get the property values for the canvas and store them in the
            // device layout context so that it will inherit from them.
            Styles styles = pattributes.getStyles();
            PropertyValues propertyValues = styles.getPropertyValues();
            ImmutablePropertyValues immutablePropertyValues =
                    propertyValues.createImmutablePropertyValues();

            DeviceLayoutContext dlc = pageContext.getDeviceLayoutContext();
            dlc.setInheritableStyleValues(immutablePropertyValues);

            if (writePage) {
View Full Code Here

    public PropertyHandler getBackgroundColorHandler() {
        return backgroundColorHandler;
    }

    protected String getMargin(Styles styles, StyleProperty property) {
        PropertyValues propertyValues = styles.getPropertyValues();
        StyleValue value = propertyValues.getComputedValue(property);
        return marginEdgeHandler.getAsString(value);
    }
View Full Code Here

TOP

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

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.