Examples of PropertyValues


Examples of com.volantis.styling.values.PropertyValues

                super.doSelectAttributes(element);

                if (!this.attributes.isMultiple()) {
                    Styles styles = attributes.getStyles();
                    PropertyValues propertyValues = styles.getPropertyValues();
                    StyleValue value = propertyValues.getComputedValue(
                            StylePropertyDetails.MCS_SELECTION_LIST_STYLE);
                    String listStyle = null;
                    if (value == MCSSelectionListStyleKeywords.CIRCULAR_LIST) {
                        listStyle = "spin";
                    } else if (value == MCSSelectionListStyleKeywords.MENU) {
View Full Code Here

Examples of com.volantis.styling.values.PropertyValues

        Styles resultStyles = result.getStyles();

        if (originalStyles == null) {
            assertNull(resultStyles);
        } else {
            PropertyValues originalValues = originalStyles.getPropertyValues();
            PropertyValues resultValues = resultStyles.getPropertyValues();
            StylePropertyDefinitions definitions =
                    StylePropertyDetails.getDefinitions();
            for(Iterator i = definitions.stylePropertyIterator(); i.hasNext();) {
                StyleProperty property = (StyleProperty)i.next();
                assertEquals(originalValues.getComputedValue(property),
                        resultValues.getComputedValue(property));
                assertEquals(originalValues.getSpecifiedValue(property),
                        resultValues.getSpecifiedValue(property));
            }
        }
    }
View Full Code Here

Examples of com.volantis.styling.values.PropertyValues

    // javadoc inherited
    public SeparatorRenderer selectMenuSeparator(Menu menu) {
        SeparatorRenderer separator = null;

        // The properties that we're interested in are applied to the menu
        final PropertyValues properties =
                menu.getElementDetails().getStyles().getPropertyValues();

        // Now see what separator should be used.
        final StyleProperty ORIENTATION_PROPERTY =
                StylePropertyDetails.MCS_MENU_ORIENTATION;

        StyleValue orientation = properties.getComputedValue(
                ORIENTATION_PROPERTY);
        if (orientation == MCSMenuOrientationKeywords.HORIZONTAL) {
            separator = factory.createHorizontalMenuSeparator(
                    properties.getComputedValue(
                            StylePropertyDetails.MCS_MENU_HORIZONTAL_SEPARATOR));
        } else if (orientation == MCSMenuOrientationKeywords.VERTICAL) {
            separator = factory.createVerticalMenuSeparator();
        } else {
            throw new IllegalStateException("Unknown keyword " +
View Full Code Here

Examples of com.volantis.styling.values.PropertyValues

        // performing automatic iteration allocation should not generate any
        // delimiters, so check for these cases
        if ((group.getPane() == null) &&
                (!performingAutoIteration((Menu)group.getContainer()))) {
            // The properties that we're interested in are applied to the group
            final PropertyValues properties =
                    group.getElementDetails().getStyles().getPropertyValues();

            // See if we should even bother to have a separator
            StyleValue position = properties.getComputedValue(
                    StylePropertyDetails.MCS_MENU_SEPARATOR_POSITION);

            if ((position == MCSMenuSeparatorPositionKeywords.BOTH) ||
                    (before && (position ==
                    MCSMenuSeparatorPositionKeywords.BEFORE)) ||
                    (!before && (position ==
                    MCSMenuSeparatorPositionKeywords.AFTER))) {

                // A separator is required for this position so determine the
                // required type of separator
                StyleValue type = properties.getComputedValue(StylePropertyDetails.MCS_MENU_SEPARATOR_TYPE);

                if (type == MCSMenuSeparatorTypeKeywords.NONE) {
                    // No separator is actually required because of this
                    // type selection
                } else if (type == MCSMenuSeparatorTypeKeywords.CHARACTERS) {
View Full Code Here

Examples of com.volantis.styling.values.PropertyValues

    // javadoc inherited
    public SeparatorRenderer selectMenuItemSeparator(Menu menu) {
        SeparatorRenderer separator = null;

        final PropertyValues properties =
                menu.getElementDetails().getStyles().getPropertyValues();

        // Now see what separator should be used.
        final StyleProperty ORIENTATION_PROPERTY =
                StylePropertyDetails.MCS_MENU_ITEM_ORIENTATION;

        StyleValue orientation = properties.getComputedValue(
                ORIENTATION_PROPERTY);
        if (orientation == MCSMenuItemOrientationKeywords.HORIZONTAL) {
            separator = factory.createHorizontalMenuItemSeparator(
                    properties.getComputedValue(
                            StylePropertyDetails.MCS_MENU_HORIZONTAL_SEPARATOR));
        } else if (orientation == MCSMenuItemOrientationKeywords.VERTICAL) {
            separator = factory.createVerticalMenuItemSeparator();
        } else {
            throw new IllegalStateException("Unknown keyword " +
View Full Code Here

Examples of com.volantis.styling.values.PropertyValues

        super.addAnchorAttributes(element, attributes);

        String value;

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

        styleValue = propertyValues.getComputedValue(
                StylePropertyDetails.MCS_LINK_MEDIA);
        element.setAttribute("view", styleValue.getStandardCSS());

        if ((value = attributes.getId()) != null) {
            String initialFocusAnchor
View Full Code Here

Examples of com.volantis.styling.values.PropertyValues

        super.addPhoneNumberAttributes(element, attributes);

        String value;

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

        styleValue = propertyValues.getComputedValue(
                StylePropertyDetails.MCS_LINK_MEDIA);
        element.setAttribute("view", styleValue.getStandardCSS());

        // Initial focus can be set by setting the initial focus name to
        // the full number associated with this phone number link
View Full Code Here

Examples of com.volantis.styling.values.PropertyValues

    }

    // Javadoc inherited.
    public MenuItemRenderer selectMenuItemRenderer(Menu menu)
            throws RendererException {
        PropertyValues properties =
                menu.getElementDetails().getStyles().getPropertyValues();

        SeparatorRenderer separator;

        // Initialise the renderer to return.
        MenuItemRenderer itemRenderer = null;

        // Initialise the top component renderer.
        MenuItemComponentRenderer top = null;

        // Select the text renderer to use.
        MenuItemComponentRenderer textRenderer = selectTextRenderer(properties);

        // Select the image renderer to use, if there is no text renderer then
        // it will need to provide alternate text.
        boolean provideAltText = (textRenderer == null);
        MenuItemComponentRenderer imageRenderer
                = selectImageRenderer(properties,
                                      provideAltText);

        // Sort out the numeric emulation required (or not)...

        // Get the menu link style
        StyleValue menuLinkStyle = properties.getComputedValue(
                StylePropertyDetails.MCS_MENU_LINK_STYLE);

        // See if numeric shortcuts were specified in the style
        // Null indicates that no emulation is required - default to this
        NumericShortcutEmulationRenderer emulation = null;

        if (menuLinkStyle == MCSMenuLinkStyleKeywords.NUMERIC_SHORTCUT) {
            // Numeric shortcuts were specified so get an emulation object from
            // the factory and use this.  NOTE: this may still be a null object
            // if the factory/protocol does not support or require numeric
            // emulation it can return null from this call to indicate that.
            emulation = factory.createNumericShortcutEmulationRenderer();
        }

        // If they have both been specified then look at some other styles.
        if (imageRenderer != null && textRenderer != null) {

            // Now see what order they should be in.
            MenuItemComponentRenderer first;
            MenuItemComponentRenderer second;

            final StyleProperty ORDER_PROPERTY
                    = StylePropertyDetails.MCS_MENU_ITEM_ORDER;

            StyleValue order = properties.getComputedValue(ORDER_PROPERTY);
            if (order == MCSMenuItemOrderKeywords.IMAGE_FIRST) {
                    first = imageRenderer;
                    second = textRenderer;
            } else if (order == MCSMenuItemOrderKeywords.TEXT_FIRST) {
                    first = textRenderer;
                    second = imageRenderer;
            } else {
                    throw new IllegalStateException
                            ("Unknown keyword " + order + " for "
                             + ORDER_PROPERTY.getName());
            }

            // Determine which component, or components is active.
            final StyleProperty ACTIVE_AREA_PROPERTY
                    = StylePropertyDetails.MCS_MENU_ITEM_ACTIVE_AREA;

            // Get the enumeration value from the properties.
            StyleValue activeArea = properties.getComputedValue(ACTIVE_AREA_PROPERTY);

            ActiveMenuItemComponent activeComponent;
            if (activeArea == MCSMenuItemActiveAreaKeywords.IMAGE_ONLY) {
                if (first == imageRenderer) {
                    activeComponent = ActiveMenuItemComponent.FIRST;
View Full Code Here

Examples of com.volantis.styling.values.PropertyValues

        StringBuffer buffer = new StringBuffer("{");

        Styles actualStyles = getActualStyles();

        if (actualStyles != null) {
            PropertyValues values = actualStyles.getPropertyValues();

            StylePropertyDefinitions definitions = values
                    .getStylePropertyDefinitions();

            boolean firstProperty = true;

            for (int index = 0; index < definitions.count(); index++) {
                StyleProperty property = definitions.getStyleProperty(index);

                String propertyName = property.getName();

                // Filter out all non-CSS standard properties.
                // At this moment the only solution I can see is to filter out
                // all properties starting with "mcs-".
                // TODO: Find better solution
                if (propertyName.startsWith("mcs-"))
                    continue;

                StyleValue value = values.getSpecifiedValue(property);

                if (value != null) {
                    // Render comma before all properties except the first one
                    if (firstProperty) {
                        firstProperty = false;
View Full Code Here

Examples of com.volantis.styling.values.PropertyValues

    // javadoc inherited from superclass
    private SelectionRenderer
            getSelectionRenderer(XFSelectAttributes attributes) {

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

        StyleValue listStyle = propertyValues.getComputedValue(
                StylePropertyDetails.MCS_SELECTION_LIST_STYLE);
        SelectionRenderer renderer = null;
        if (listStyle != MCSSelectionListStyleKeywords.CONTROLS) {
            // protocol do not need to be thread-safe so it is OK to do this
            if (null == defaultSelectionRenderer) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.