Package com.volantis.styling

Examples of com.volantis.styling.Styles


     * @param protocol
     * @param attributes
     * @return
     */
    protected Styles getFoldedMarkerStyles(VolantisProtocol protocol, MCSAttributes attributes){
        Styles styles = attributes.getStyles();
        return styles.findNestedStyles(PseudoElements.MARKER);
    }
View Full Code Here


     * @param protocol
     * @param attributes
     * @return Styles or null if not specified
     */
    protected Styles getUnfoldedMarkerStyles(VolantisProtocol protocol, MCSAttributes attributes){
        Styles styles = attributes.getStyles();
        Styles unfoldedStyles = styles.findNestedStyles(StatefulPseudoClasses.MCS_UNFOLDED);
        Styles markerStyles = null;
        if(null != unfoldedStyles){
            markerStyles = unfoldedStyles.findNestedStyles(PseudoElements.MARKER);
        }
        return markerStyles;
    }
View Full Code Here

     * @param attributes MCSAttributes of element
     */
    protected void clearMarkerContent(MCSAttributes attributes) {

        // Retrieve styles from attributes
        Styles styles = attributes.getStyles();

        // Get marker styles
        Styles markerStyles = styles.findNestedStyles(PseudoElements.MARKER);

        if (markerStyles != null) {
            // clear content in marker pseudo element
            markerStyles.getPropertyValues().clearPropertyValue(StylePropertyDetails.CONTENT);
        }

        // Get styles from mcs-unfolded pseudo class
        Styles unfoldedStyles = styles.findNestedStyles(StatefulPseudoClasses.MCS_UNFOLDED);

        if (unfoldedStyles != null) {
            // Get marker styles from mcs-unfolded pseudo class
            markerStyles = unfoldedStyles.findNestedStyles(PseudoElements.MARKER);

            if (markerStyles != null) {
                // clear content in marker pseudo element
                markerStyles.getPropertyValues().clearPropertyValue(StylePropertyDetails.CONTENT);
            }
View Full Code Here

        return getHRAttributes("");
    }

    private HorizontalRuleAttributes getHRAttributes(String additionalCSS) {
        HorizontalRuleAttributes attrs = new HorizontalRuleAttributes();
        Styles styles = StylesBuilder.getCompleteStyles(
                "color: red; width: 50%; height: 5px; " + additionalCSS);
        attrs.setStyles(styles);
        return attrs;
    }
View Full Code Here

    // Javadoc inherited.
    public void applyStyleToElement(Element element) {

        if (isElementToBeStyled(element)) {

            Styles styles = element.getStyles();

            if (styles != null) {
                MutablePropertyValues propertyValues =
                        styles.getPropertyValues();
                if (propertyValues != null) {
                    propertiesRenderer.applyProperties(element, propertyValues);
                }
            }
View Full Code Here

    // Javadoc inherited.
    public void visit(Element element) {

        // Before processing the children.
        Styles styles = element.getStyles();
        boolean visitChildren;
        if (styles == null) {
            // If the element is the root of the document then visit its
            // children even if it does not have styles as the <html> element
            // does not have styles. Otherwise if it does not have styles then
View Full Code Here

    private StyleValues getParentValues(Element element) {
        Element parent = element.getParent();
        StyleValues parentValues = null;
        if (parent != null) {
            Styles parentStyles = parent.getStyles();
            if (parentStyles != null) {
                parentValues = parentStyles.findPropertyValues();
            }
        }
        if (parentValues == null) {
            parentValues = rootStyleValues;
        }
View Full Code Here

        // According to the CSS specification a width value of auto is treated
        // as 100% on block elements. Unfortunately, for backwards
        // compatibility reasons layouts can generate widths of 100% so convert
        // them back to auto so that they do not appear in the output.
        Styles styles = container.getStyles();
        MutablePropertyValues propertyValues = styles.getPropertyValues();
        StyleValue value = propertyValues.getStyleValue(StylePropertyDetails.WIDTH);
        if (value.equals(HUNDRED_PERCENT)) {
            propertyValues.setComputedValue(StylePropertyDetails.WIDTH,
                    WidthKeywords.AUTO);
        }
View Full Code Here

        TableLayers layers = new TableLayers();

        // Style the grid, and then style all of its columns.
        FormatStylingEngine formatStylingEngine =
                context.getFormatStylingEngine();
        Styles formatStyles = formatStylingEngine.startStyleable(
                grid, grid.getStyleClass());
        layers.setLayer(TableLayers.TABLE, formatStyles);

        attributes.setStyles(formatStyles);
        attributes.setLayers(layers);

        // Style the columns so that we can pick up the height and any
        // other properties associated with the column's style class
        // if any.

        // Style the group of columns. This is to simply group the grid columns
        // together within a single element to simplify the use of those
        // selectors that rely on the position of an element within its parent,
        // e.g. nth-child().
        Styles columnGroupStyles = formatStylingEngine.startStyleable(
                SyntheticStyleableFormat.GRID_COLUMNS,
                null);
        layers.setLayer(TableLayers.COLUMN_GROUP, columnGroupStyles);

        Styles[] columnStyles = getColumnStyles(grid, formatStylingEngine,
                requiredColumns);

        formatStylingEngine.endStyleable(
                SyntheticStyleableFormat.GRID_COLUMNS);

        if (logger.isDebugEnabled()) {
            logger.debug("Grid.writeOutput()");
        }

        attributes.setColumns(columns);

        // Should the order of the columns be reversed,
        // false = 0...n, true = n...0
        boolean reversed =
                DirectionHelper.isDirectionReversed(grid, formatStyles);

        // Open the grid, even if no rows are written
        attributes.setFormat(grid);
        module.writeOpenGrid(attributes);

        // Style the group of rows. See the comment in getColumnStyles().
        Styles bodyStyles = formatStylingEngine.startStyleable(
                SyntheticStyleableFormat.GRID_BODY, null);
        layers.setLayer(TableLayers.ROW_GROUP, bodyStyles);

        // Write out children
        for (int r = 0; r < grid.getRows(); r++) {
View Full Code Here

        Row row = grid.getRow(rowPosition);

        FormatStylingEngine formatStylingEngine =
                context.getFormatStylingEngine();
        Styles rowStyles = formatStylingEngine.startStyleable(
                row, row.getStyleClass());
        layers.setLayer(TableLayers.ROW, rowStyles);

        GridRowAttributes rowAttributes = gridInstance.getRowAttributes();
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.