Package com.volantis.styling

Examples of com.volantis.styling.Styles



    public void visit(Element element) {

        // now inside a supported list: ul, ol, nl, etc
        final Styles styles = element.getStyles();
        if (styles != null) {
            DOMFactory domFactory = element.getDOMFactory();
            Element tr = domFactory.createElement(TR);
            tr.setStyles(styles);

            // Clear the display property as this is not a list-item
            // any more.
            styles.getPropertyValues()
                    .clearPropertyValue(StylePropertyDetails.DISPLAY);

            createMarkerTD(domFactory, tr, styles);

            createContentTD(domFactory, tr, element);
View Full Code Here


            Styles styles) {

        Element markerTd = domFactory.createElement(TD);
        tr.addTail(markerTd);

        Styles markerStyles = styles.removeNestedStyles(PseudoElements.MARKER);
        if (markerStyles == null) {
            markerStyles = stylingFactory.createInheritedStyles(
                    styles, DisplayKeywords.TABLE_CELL);
        }

        markerTd.setStyles(markerStyles);
        MutablePropertyValues propertyValues =
                markerStyles.getPropertyValues();
        StyleValue content = propertyValues.getComputedValue(
                StylePropertyDetails.CONTENT);

        // Make sure that the display is set correctly on the td.
        propertyValues.setComputedValue(StylePropertyDetails.DISPLAY,
View Full Code Here

            DOMFactory domFactory, Element tr, Element element) {

        Element contentTd = domFactory.createElement(TD);

        // todo don't use this as it does not handle styles from default.css properly.
        Styles styles = stylingFactory.createInheritedStyles(tr.getStyles(),
                DisplayKeywords.TABLE_CELL);
        MutablePropertyValues propertyValues = styles.getPropertyValues();

        // Make sure that the content is at the top of the table cell unless
        // it has been explicitly specified to be elsewhere.
        overrideVerticalAlign(propertyValues);
View Full Code Here

        }

        // Get the styles associated with the fragment.
        FormatStylingEngine formatStylingEngine =
                formatRendererContext.getFormatStylingEngine();
        Styles styles = formatStylingEngine.startStyleable(source, styleClass);
        a.setStyles(styles);

        if (pageContext.getPageTagId() != null) {
            a.setId(pageContext.getPageTagId());
        }
View Full Code Here

     * div
     * @param divHr
     */
    private void addBorderStyling(Element divHr) {

        Styles styles = divHr.getStyles();
        MutablePropertyValues propertyValues = styles.getPropertyValues();

        // Handle border-bottom style attribute
        if (BORDER_BOTTOM_PROPERTY.equals(borderProperty)) {
            propertyValues.setComputedValue(
                    StylePropertyDetails.BORDER_BOTTOM_WIDTH, height);
View Full Code Here

        }

        if (allEffectsNeeded) {
            effectStyles.add("all");
        } else if (attributes != null && attributes.getStyles() != null) {
            Styles styles = attributes.getStyles();
            StylesExtractor concealedExtractor = new StylesExtractor(styles, StatefulPseudoClasses.MCS_CONCEALED);
            StylesExtractor extractor = new StylesExtractor(styles, null);
            effectStyles.addAll(extractor.getEffectsList());
            effectStyles.addAll(concealedExtractor.getEffectsList());
        }
View Full Code Here

    /**
     * append the margin default values if they have not already been set
     * @param divHr Emulation Element
     */
    protected void setMargins(Element divHr) {
        Styles styles = divHr.getStyles();
        MutablePropertyValues propertyValues = styles.getPropertyValues();

        // Handle margin-top and margin-bottom
        propertyValues.setComputedValue(StylePropertyDetails.MARGIN_BOTTOM,
                marginBottom);

View Full Code Here

        // Open the div
        Element div = domOutputBuffer.addElement("div");

        // Apply margin styling
        Styles styles;
        StylingFactory stylingFactory = StylingFactory.getDefaultInstance();
        Styles parentStyles = domOutputBuffer.getCurrentElement().getStyles();
        if (parentStyles != null) {
            styles = stylingFactory.createInheritedStyles(parentStyles,
                    DisplayKeywords.BLOCK);
        } else {
            styles = stylingFactory.createStyles(null);
View Full Code Here

    public Element doEmulation(DOMOutputBuffer domOutputBuffer,
                                         HorizontalRuleAttributes hrAttrs)
            throws ProtocolException {

        Element hr = domOutputBuffer.addStyledElement("hr", hrAttrs);
        Styles styles = hr.getStyles();
        MutablePropertyValues propertyValues = styles.getPropertyValues();

        // Don't need to set these as specified as these values are not the
        // initial values and hence can never be cleared.
        propertyValues.setComputedValue(
                StylePropertyDetails.BORDER_TOP_WIDTH, height);
View Full Code Here

                // Then we may be able to join this block onto the previous one
                // with a br. Let's check....

                // NOTE: this could be a bit more efficient but I am interestedf
                Styles previousStyles = getStylesForElement(previous);
                Styles elementStyles = getStylesForElement(element);
                String previousMode =
                        paragraphModeHandler.getAsString(previousStyles);
                String mode =
                        paragraphModeHandler.getAsString(elementStyles);
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.