Package com.volantis.styling

Examples of com.volantis.styling.Styles


        ContextInternals.setMarinerPageContext(requestContext, pageContext);
        protocol.setMarinerPageContext(pageContext);

        MenuElementImpl menuElement = new MenuElementImpl();
        Styles testStyles = StylesBuilder.getStyles(
                "mcs-menu-image-style: rollover");

        PrivateAccessor.setField(menuElement, "menuProperties",
                testStyles.getPropertyValues());
        pageContext.pushElement(menuElement);

        pageContext.setPolicyReferenceResolver(
                PolicyReferenceResolverTestHelper.getCommonExpectations(
                        expectations, mockFactory));
View Full Code Here


                        expectations, mockFactory));

        // need to set up parent element with properties otherwise there will
        // be a NPE in #setNormalAndOverImages
        MenuElementImpl menuElement = new MenuElementImpl();
        Styles testStyles = StylesBuilder.getStyles(
                "mcs-menu-image-style: rollover");
        PrivateAccessor.setField(menuElement, "menuProperties",
                testStyles.getPropertyValues());
        pageContext.pushElement(menuElement);

        MenuModelBuilder menuModelBuilder = pageContext.getMenuBuilder();
        //builder#startMenuItem will fail unless this has been called
        menuModelBuilder.startMenu();
View Full Code Here

        throws RendererException {

        MenuLabel label = item.getLabel();
        MenuText text = label.getText();
        ElementDetails elementDetails = text.getElementDetails();
        Styles styles = null;
        if (elementDetails != null) {
            styles = elementDetails.getStyles();
        }

        DOMOutputBuffer outputBuffer = (DOMOutputBuffer) buffer;
View Full Code Here

        Element element = outputBuffer.openElement("link");

        // Only add the style class from the menu item if this is an outer link.
        if (outer) {
            ElementDetails elementDetails = item.getElementDetails();
            Styles styles = elementDetails.getStyles();
            if (styles != null) {
                element.setStyles(styles);
            }
        }
        element.setAttribute("href", item.getHref().getURL());
View Full Code Here

            newStyles.values = new MutablePropertyValuesImpl(values);
        }
        if (nestedStylesList != null) {
            newStyles.nestedStylesList = new ArrayList();
            for (int i = 0; i < nestedStylesList.size(); i++) {
                Styles styles = (Styles) nestedStylesList.get(i);
                newStyles.nestedStylesList.add(styles.copy());
            }
        }

        return newStyles;
    }
View Full Code Here

    // Javadoc inherited.
    public void applyTo(StylerContext context) {

        StandardStylerContext standardContext = (StandardStylerContext) context;
        Styles styles = standardContext.getStyles();

        // Iterate through the entities (if any) getting the styles associated
        // with them.
        if (entities != null) {
            for (int i = 0; i < entities.length; i++) {
                PseudoStyleEntity entity = entities[i];
                styles = styles.getNestedStyles(entity);
            }
        }

        MutablePropertyValues target = styles.getPropertyValues();

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

                    parent.getPropertyValues();
            iterator = parentPropertyValues.stylePropertyIterator();
            parentValues = parentPropertyValues;
        }

        Styles styles = createInheritedStyles(iterator, parentValues, display);

        return styles;
    }
View Full Code Here

    private Styles createInheritedStyles(
            Iterator iterator, StyleValues parentValues,
            StyleKeyword display) {

        InitialValueFinder initialValueFinder = new InitialValueFinder();
        Styles styles = new StylesImpl();
        MutablePropertyValues propertyValues = styles.getPropertyValues();
        while (iterator.hasNext()) {
            StyleProperty property = (StyleProperty) iterator.next();
            StyleValue value;
            if (property.getStandardDetails().isInherited()) {
                value = parentValues.getStyleValue(property);
View Full Code Here

        if (nullStyles) {
            assertNull("Styles should not be changed after remapping",
                    element.getStyles());
        } else {
            // check the retention of style information
            Styles stylesAfterRemap = element.getStyles();
            assertNotNull("Styles should not be null after remapping to div",
                    stylesAfterRemap);

            assertEquals("Styles should be preserved after remapping",
                    textAlign, stylesAfterRemap.getPropertyValues().
                    getComputedValue(StylePropertyDetails.TEXT_ALIGN));

            assertEquals("Styles should be preserved after remapping",
                    parentPadding, stylesAfterRemap.getPropertyValues().
                    getComputedValue(StylePropertyDetails.PADDING_BOTTOM));
        }
    }
View Full Code Here

            // It is ok to clear the styles as this element will be pruned at
            // a later date.
            element.clearStyles();
        } else {
            element.setName(getName());
            Styles styles = element.getStyles();
            if (styles != null) {
                styles.getPropertyValues().setComputedValue(
                        StylePropertyDetails.DISPLAY, display);
            }

            if (validAttributes == null) {
                element.clearAttributes();
View Full Code Here

TOP

Related Classes of com.volantis.styling.Styles

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.