Package com.volantis.mcs.themes

Examples of com.volantis.mcs.themes.Rule


            StyleSheetFactory factory) {
        super(converter, factory);
    }

    public void addRules(StyleSheet styleSheet, Format format) {
        Rule rule = createRuleWithoutProperties(format);

        MutableStyleProperties styleProperties =
            ThemeFactory.getDefaultInstance().createMutableStyleProperties();

        // A grid is equivalent to a CSS table.
        initialiseCommonProperties(styleProperties, format,
                DisplayKeywords.TABLE);

        rule.setProperties(styleProperties);
        styleSheet.addRule(rule);

        Grid grid = (Grid) format;

        // Handle the columns.
View Full Code Here


    private void addCellRules(
            StyleSheet styleSheet, Grid grid, Row row, int column,
            Format child) {

        Rule rule = ThemeFactory.getDefaultInstance().createRule();

        SelectorSequence context = createContextualSelectorSequence(row);
        Subject subject = createNthChildSelector(column);
        CombinedSelector selector = factory.createCombinedSelector();
        selector.setCombinator(CombinatorEnum.CHILD);
        selector.setContext(context);
        selector.setSubject(subject);

        List selectors = new ArrayList();
        selectors.add(selector);
        rule.setSelectors(selectors);

        MutableStyleProperties styleProperties =
            ThemeFactory.getDefaultInstance().createMutableStyleProperties();

        // A grid cell is equivalent to a CSS table cell.
        styleProperties.setStyleValue(StylePropertyDetails.DISPLAY,
                DisplayKeywords.TABLE_CELL);

        StyleValue value;
        if (child != null) {
            value = converter.getHorizontalAlign(child.getHorizontalAlignment());
            if (value != null) {
                styleProperties.setStyleValue(StylePropertyDetails.TEXT_ALIGN,
                                              value);
            }

            value = converter.getVerticalAlign(child.getVerticalAlignment());
            if (value != null) {
                styleProperties.setStyleValue(StylePropertyDetails.VERTICAL_ALIGN,
                                              value);
            }
        }

        // Apply the cell padding from the grid as padding on the cells.
        setPadding(styleProperties, grid);

        rule.setProperties(styleProperties);

        styleSheet.addRule(rule);
    }
View Full Code Here

        sequence.addSelector(nthChild);
        return sequence;
    }

    private void addRowRules(StyleSheet styleSheet, Row row) {
        Rule rule = createRuleWithoutProperties(row);

        MutableStyleProperties styleProperties =
            ThemeFactory.getDefaultInstance().createMutableStyleProperties();

        // A grid row is equivalent to a CSS table row.
        styleProperties.setStyleValue(StylePropertyDetails.DISPLAY,
                DisplayKeywords.TABLE_ROW);

        StyleValue value = converter.getDimensionValue(row.getHeight(),
                row.getHeightUnits());
        if (value != null) {
            styleProperties.setStyleValue(StylePropertyDetails.HEIGHT, value);
        }

        rule.setProperties(styleProperties);
        styleSheet.addRule(rule);
    }
View Full Code Here

        rule.setProperties(styleProperties);
        styleSheet.addRule(rule);
    }

    private void addColumnRules(StyleSheet styleSheet, Column column) {
        Rule rule = createRuleWithoutProperties(column);

        MutableStyleProperties styleProperties =
            ThemeFactory.getDefaultInstance().createMutableStyleProperties();

        StyleValue value = converter.getDimensionValue(column.getWidth(),
                column.getWidthUnits());
        if (value != null) {
            styleProperties.setStyleValue(StylePropertyDetails.WIDTH, value);
        }

        rule.setProperties(styleProperties);
        styleSheet.addRule(rule);
    }
View Full Code Here

TOP

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

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.