Package com.volantis.mcs.themes

Examples of com.volantis.mcs.themes.PropertyValue


            writer.print(" ");
        }

        writer.print("{");
        for (int i = 0; i < propertyValues.length; i++) {
            PropertyValue propertyValue = propertyValues[i];
            writer.print(propertyValue.getProperty(),
                    propertyValue.getValue(), ";");
        }
        writer.print("}");
    }
View Full Code Here


                            StyleProperty details = (StyleProperty) it.next();
                            PropertyIdentifier identifier = ThemeModel.
                                getPropertyIdentifierForStyleProperty(details);
                            Proxy propertyProxy =
                                    stylePropertiesProxy.getPropertyProxy(identifier);
                            PropertyValue value =
                                ThemeFactory.getDefaultInstance().
                                    createPropertyValue(
                                        details, THEME_FACTORY.getInherit());
                            propertyProxy.setModelObject(value);
                        }
                    }
                    stylePropertiesProxyReceiver.setProxy(stylePropertiesProxy);
                }
            }
        };

        priorityAction = new ResourceAction(
                    ThemesMessages.getResourceBundle(),
                    RESOURCE_PREFIX + "allToImportant.") {
            // Javadoc inherited
            public void run() {
                ISelection selection = categoryTreeViewer.getSelection();
                if (selection instanceof IStructuredSelection) {
                    BeanProxy stylePropertiesProxy =
                            (BeanProxy) stylePropertiesProxyProvider.getProxy();
                    IStructuredSelection structuredSelection =
                            (IStructuredSelection) selection;
                    Iterator categories = structuredSelection.iterator();
                    while (categories.hasNext()) {
                        StyleCategory category = (StyleCategory) categories.next();
                        Iterator it = category.getProperties().iterator();
                        while (it.hasNext()) {
                            StyleProperty details = (StyleProperty) it.next();
                            PropertyIdentifier identifier = ThemeModel.
                                getPropertyIdentifierForStyleProperty(details);
                            Proxy propertyProxy =
                                    stylePropertiesProxy.getPropertyProxy(identifier);
                            PropertyValue value = (PropertyValue) propertyProxy.getModelObject();
                            if (value != null) {
                                value = ThemeFactory.getDefaultInstance().
                                    createPropertyValue(value.getProperty(),
                                        value.getValue(), Priority.IMPORTANT);
                                propertyProxy.setModelObject(value);
                            }
                        }
                    }
                    stylePropertiesProxyReceiver.setProxy(stylePropertiesProxy);
View Full Code Here

     */
    public PropertyValue getPropertyValue() {
        // Check if the first could actually be a StyleKeyword
        final String firstValue = first.getValue();
        final EditorPropertyParser parser = new EditorPropertyParser();
        PropertyValue value = parser.parsePropertyValue(property,
                firstValue, isImportant());

        // Ignore the second value if the first is a keyword or inherit.
        if (value == null || !(value.getValue() instanceof StyleKeyword ||
                value.getValue() instanceof StyleInherit)) {
            // If it's not then parse the whole fraction.
            value = parser.parsePropertyValue(property,getStringValue(),
                    isImportant());
        }
        return value;
View Full Code Here

     * @param property The identifier for the property
     */
    private void stylePropertyChanged(PropertiesComposite composite, PropertyIdentifier property) {
        if (styleProperties != null) {
            Proxy valueProxy = styleProperties.getPropertyProxy(property);
            PropertyValue newPropertyValue = (PropertyValue)
                    composite.getProperty(property);
            PropertyValue oldPropertyValue = (PropertyValue)
                    valueProxy.getModelObject();
            // Only set the value if it has changed - prevents changes that
            // don't alter the value (such as adding irrelevant whitespace)
            // from being seen as modifications leading to exceptions when
            // carrying out the set operation.
View Full Code Here

                List diagnostics = property.getDiagnostics();
                if (diagnostics != null && !diagnostics.isEmpty()) {
                    imageValue = ERROR_IMAGE;
                }
            } else if (i == COLUMN_IMPORTANT) {
                PropertyValue value = (PropertyValue) property.getModelObject();
                if (value != null && value.getPriority() == Priority.IMPORTANT) {
                    imageValue = IMPORTANT_IMAGE;
                }
            }
            return imageValue;
        }
View Full Code Here

                PropertyIdentifier identifier = parent.getPropertyForProxy(property);
                StyleProperty styleProperty = ThemeModel.getStylePropertyForPropertyIdentifier(identifier);
                stringValue = styleProperty.getName();
                stringValue = EclipseCommonMessages.getString("PolicyName." + stringValue);
            } else if (i == COLUMN_VALUE) {
                PropertyValue propertyValue = (PropertyValue) property.getModelObject();
                stringValue = propertyValueToString(propertyValue);
            }
            return stringValue;
        }
View Full Code Here

                // contains a value which doesn't support a type (e.g.
                // StyleKeyword) or if it's empty (because it will be enabled when
                // the editable combo associated with it is edited).
                if (!"".equals(text)) {
                    EditorPropertyParser parser = new EditorPropertyParser();
                    PropertyValue propertyValue = parser.parsePropertyValue(
                            property, text, isImportant());
                    StyleValue value = propertyValue.getValue();
                    if (!(value instanceof StyleKeyword ||
                            value instanceof StyleInherit)) {
                        unitsCombo.setEnabled(b);
                    }
                }
View Full Code Here

        }

        properties = addSystemFont(properties);

        for (Iterator i = properties.propertyValueIterator(); i.hasNext();) {
            PropertyValue propertyValue = (PropertyValue) i.next();

            StyleValue value = propertyValue.getValue();

            // Compile the value.
            StyleValue compiledValue = compiler.compile(value);

            // If compiling changed the value then create a new property value.
            Priority priority = propertyValue.getPriority();
            if (compiledValue != value) {
                propertyValue = ThemeFactory.getDefaultInstance().
                    createPropertyValue(propertyValue.getProperty(),
                        compiledValue, priority);
            }

            PropertyValueArray array = (PropertyValueArray)
                    priority2Values.get(priority);
View Full Code Here

    }

    private StyleProperties addSystemFont(StyleProperties properties) {
        // The mcs-system-font property is equivalent to setting all properties
        // set by the font shorthand to unknown user agent specific values.
        PropertyValue systemFont = properties.getPropertyValue(MCS_SYSTEM_FONT);
        if (systemFont != null) {
            Priority systemFontPriority = systemFont.getPriority();
            MutableStyleProperties copy =
                ThemeFactory.getDefaultInstance().createMutableStyleProperties(
                    properties);

            // The system font is set so make sure that all the other font
            // properties are set with equal or greater priority.
            for (int i = 0; i < UNKNOWN_FONT_PROPERTIES.length; i++) {
                PropertyValue value = UNKNOWN_FONT_PROPERTIES[i];
                StyleProperty property = value.getProperty();

                PropertyValue propertyValue = properties.getPropertyValue(
                        property);
                if (propertyValue == null ||
                        systemFontPriority.isGreaterThan(
                                propertyValue.getPriority())) {

                    propertyValue =
                        ThemeFactory.getDefaultInstance().createPropertyValue(
                            property, UnknownFontValue.INSTANCE,
                            systemFontPriority);
View Full Code Here

    }

    public IterationAction next(PropertyValue subsetValue) {

        StyleProperty property = subsetValue.getProperty();
        PropertyValue propertyValue = properties.getPropertyValue(property);
        if (subsetValue.equals(propertyValue)) {
            // the property is in both sets with the same
            // value. In this case, leave the subset
            // as it is.
        } else {
View Full Code Here

TOP

Related Classes of com.volantis.mcs.themes.PropertyValue

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.