Package com.volantis.styling.values

Examples of com.volantis.styling.values.PropertyValues


     */
    protected MenuRenderer getMenuRenderer(MenuAttributes attributes) {
        MenuRenderer menuRenderer = null;

        Styles styles = attributes.getStyles();
        PropertyValues propertyValues = styles.getPropertyValues();
        StyleValue styleValue = propertyValues.getComputedValue(
                StylePropertyDetails.MCS_MENU_LINK_STYLE);
        if (styleValue == MCSMenuLinkStyleKeywords.NUMERIC_SHORTCUT) {
            // need to render a numeric shortcut menu. Lazily create the
            // appropriate renderer. Not all protocols support numeric
            // shortcut menus, those that don't will return null from
View Full Code Here


                                boolean iteratorPane,
                                MenuOrientation orientation)
        throws ProtocolException {

        Styles styles = child.getStyles();
        PropertyValues propertyValues = styles.getPropertyValues();
        StyleValue styleValue;
        ImageAttributes imageAttributes = null;
        int separatorRepeat = 0;
        String separatorCharacters = null;

        styleValue = propertyValues.getComputedValue(
                StylePropertyDetails.MCS_MENU_SEPARATOR_TYPE);
        if (styleValue == MCSMenuSeparatorTypeKeywords.IMAGE) {
            styleValue = propertyValues.getComputedValue(
                    StylePropertyDetails.MCS_MENU_SEPARATOR_IMAGE);
            imageAttributes =
                    createImageAttributesMenuSeparator(child, styleValue);
        } else {
            // If the repeat is null then set it to a default of 0
            StyleValue repeat = propertyValues.getComputedValue(
                    StylePropertyDetails.MCS_MENU_SEPARATOR_REPEAT);
            if (repeat instanceof StyleInteger) {
                separatorRepeat = ((StyleInteger) repeat).getInteger();
            }

            // increase separatorRepeat as the protocols must render the
            // separator atleast once and one more time than the repeat count
            separatorRepeat++;

            separatorCharacters = ((StyleString)
                    propertyValues.getComputedValue(
                            StylePropertyDetails.MCS_MENU_SEPARATOR_CHARACTERS))
                    .getString();
        }

        // Only bother to render the separator before the menu item
View Full Code Here

    /**
     * Tests the give style if the requried value passed in is set or if the
     * menu separator 'both' position is set
     */
    private boolean shouldRenderSeparator(StyleKeyword requiredValue, Styles styles) {
        PropertyValues propertyValues = styles.getPropertyValues();
        StyleValue actual = propertyValues.getComputedValue(
                StylePropertyDetails.MCS_MENU_SEPARATOR_POSITION);

        //test the given value against the valued specified in the style.
        return actual == requiredValue || actual == MCSMenuSeparatorPositionKeywords.BOTH;
    }
View Full Code Here

        if (styles == null) {
            // todo remove this when old dissector is removed.
            return MenuOrientation.UNKNOWN;
        }

        PropertyValues propertyValues = styles.getPropertyValues();
        StyleValue styleValue = propertyValues.getComputedValue(
                StylePropertyDetails.MCS_MENU_ORIENTATION);
        if (styleValue == MCSMenuOrientationKeywords.HORIZONTAL) {
            orientation = MenuOrientation.HORIZONTAL;
        } else if (styleValue == MCSMenuOrientationKeywords.VERTICAL) {
            orientation = MenuOrientation.VERTICAL;
View Full Code Here

    protected boolean areTableStylesSignificant(
            Element cell, Element row, TransTableHelper helper) {

        // todo fix the tests so that they set up the styles properly so we can removed these fracking null tests.
        final Styles tableStyles = table.getStyles();
        PropertyValues tableProps;
        if (tableStyles == null) {
            tableProps = null;
        } else {
            tableProps = tableStyles.getPropertyValues();
        }

        final Styles rowStyles = row.getStyles();
        PropertyValues rowProps;
        if (rowStyles == null) {
            rowProps = null;
        } else {
        rowProps = rowStyles.getPropertyValues();
        }

        final Styles cellStyles = cell.getStyles();
        PropertyValues cellProps;
        if (cellStyles == null) {
            cellProps = null;
        } else {
            cellProps = cellStyles.getPropertyValues();
        }
View Full Code Here

        paddingChecker = lengthGreaterThanZero;
    }

    public boolean checkTable(Styles styles) {

        PropertyValues propertyValues = styles.getPropertyValues();
        StyleValue value;

        value = propertyValues.getComputedValue(StylePropertyDetails.WIDTH);
        boolean hasWidth = widthChecker.isSignificant(styles);

        boolean hasBorderWidth = checkEdges(
                propertyValues, PropertyGroups.BORDER_WIDTH_PROPERTIES,
                borderWidthChecker);

        boolean hasCellPadding = checkEdges(
                propertyValues, PropertyGroups.PADDING_PROPERTIES,
                paddingChecker);

        value = propertyValues.getComputedValue(
                StylePropertyDetails.BORDER_SPACING);
        boolean hasCellSpacing = borderSpacingChecker.isSignificant(value);

        return hasWidth || hasBorderWidth || hasCellPadding || hasCellSpacing;
    }
View Full Code Here

            // List separators must respect the mariner-list-* styles, so
            // before we can add it, we must decide which style they wanted.
            // The default style is vertical (ala real menus).
            boolean horizontal = false;
            Styles styles = attributes.getStyles();
            PropertyValues propertyValues = styles.getPropertyValues();
            StyleValue value = propertyValues.getComputedValue(
                    StylePropertyDetails.MCS_FRAGMENT_LIST_ORIENTATION);
            if (value == MCSFragmentListOrientationKeywords.HORIZONTAL) {
                horizontal = true;
            }

View Full Code Here

    // Javadoc inherited.
    public void doMenu(MenuAttributes attributes) throws ProtocolException {

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

        // Initialise the content buffer.
        Pane pane = attributes.getPane();
        // NOTE: old menu code is unused.
        ContainerInstance containerInstance =
                (ContainerInstance) context.getFormatInstance(pane,
                        NDimensionalIndex.ZERO_DIMENSIONS);
        DOMOutputBuffer dom = (DOMOutputBuffer)
                containerInstance.getCurrentBuffer();

        Element menu = dom.openStyledElement("menu", attributes);

        // Add the id attribute if there is one.
        String id = attributes.getId();
        if (id != null) {
            menu.setAttribute("id", id);
        }

        StyleValue styleValue;
        styleValue = propertyValues.getComputedValue(
                StylePropertyDetails.MCS_AURAL_MENU_SCOPE);
        String scope = styleValue.getStandardCSS();
        menu.setAttribute("scope", scope);

        styleValue = propertyValues.getComputedValue(
                StylePropertyDetails.MCS_AURAL_DTMF_ALLOCATION);
        boolean manualDTMF = styleValue == MCSAuralDTMFAllocationKeywords.MANUAL;
        if (!manualDTMF) {
            menu.setAttribute("dtmf", "true");
        }
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.