Package com.sun.star.report.pentaho.model

Examples of com.sun.star.report.pentaho.model.OfficeStyle


        {
            // fine, there's already a copy of the stylesheet.
            return;
        }

        final OfficeStyle predefCommonStyle =
                predefCollection.getCommonStyles().getStyle(styleFamily, styleName);
        if (predefCommonStyle != null)
        {
            // so we have an style from the predefined collection.
            // copy it an add it to the current stylescollection
            final OfficeStyles commonStyles = commonCollection.getCommonStyles();

            copyStyleInternal(predefCommonStyle, commonStyles, stylesCollection,
                    commonCollection, predefCollection, styleFamily, inheritanceTracker);
            return;
        }

        final OfficeStyle predefAutoStyle =
                predefCollection.getAutomaticStyles().getStyle(styleFamily, styleName);
        if (predefAutoStyle != null)
        {
            // so we have an style from the predefined collection.
            // copy it an add it to the current stylescollection
            final OfficeStyles autoStyles = stylesCollection.getAutomaticStyles();
            copyStyleInternal(predefAutoStyle, autoStyles, stylesCollection,
                    commonCollection, predefCollection, styleFamily, inheritanceTracker);
            return;
        }

        // There is no automatic style either. Now this means that someone
        // messed up the fileformat. Lets create a new empty style for this.
        final OfficeStyle autostyle = new OfficeStyle();
        autostyle.setNamespace(OfficeNamespaces.STYLE_NS);
        autostyle.setType(STYLE);
        autostyle.setStyleFamily(styleFamily);
        autostyle.setStyleName(styleName);

        final OfficeStyles autoStyles = stylesCollection.getAutomaticStyles();
        autoStyles.addStyle(autostyle);
    }
View Full Code Here


            final Set inheritanceTracker)
            throws ReportProcessingException
    {
        try
        {
            final OfficeStyle preStyle = (OfficeStyle) predefCommonStyle.clone();
            styles.addStyle(preStyle);
            performFontFaceProcessing(preStyle, stylesCollection, predefCollection);
            performDataStyleProcessing(preStyle, stylesCollection, predefCollection);

            // Lookup the parent style ..
            final String styleParent = preStyle.getStyleParent();
            final OfficeStyle inherited =
                    stylesCollection.getStyle(styleFamily, styleParent);
            if (inherited != null)
            {
                // OK, recurse (and hope that we dont run into an infinite loop) ..
                copyStyle(styleFamily, styleParent, stylesCollection,
View Full Code Here

            throw new NullPointerException("StyleFamily must not be null");
        }
        if (styleName != null)
        {

            final OfficeStyle currentAuto =
                    stylesCollection.getAutomaticStyles().getStyle(styleFamily,
                    styleName);
            if (currentAuto != null)
            {
                // handle an automatic style ..
                final OfficeStyle derivedStyle =
                        deriveAutomaticStyle(currentAuto, styleFamily, styleName,
                        generator, commonCollection, predefCollection);
                stylesCollection.getAutomaticStyles().addStyle(derivedStyle);
                return derivedStyle;
            }

            final OfficeStyle currentCommon =
                    stylesCollection.getCommonStyles().getStyle(styleFamily, styleName);
            if (currentCommon != null)
            {
                // handle an common style ..
                final OfficeStyle derivedStyle =
                        deriveCommonStyle(currentCommon, styleFamily, styleName,
                        generator, commonCollection, predefCollection);
                stylesCollection.getAutomaticStyles().addStyle(derivedStyle);
                return derivedStyle;
            }

//      final OfficeStyle commonAuto =
//          commonCollection.getAutomaticStyles().getStyle(styleFamily,
//              styleName);
//      if (commonAuto != null)
//      {
//        // handle an automatic style ..
//        final OfficeStyle derivedStyle =
//            deriveAutomaticStyle(commonAuto, styleFamily, styleName,
//                generator, commonCollection, predefCollection);
//        stylesCollection.getAutomaticStyles().addStyle(derivedStyle);
//        return derivedStyle;
//      }

            final OfficeStyle commonCommon =
                    commonCollection.getCommonStyles().getStyle(styleFamily, styleName);
            if (commonCommon != null)
            {
                // handle an common style ..
                final OfficeStyle derivedStyle =
                        deriveCommonStyle(commonCommon, styleFamily, styleName,
                        generator, commonCollection, predefCollection);
                stylesCollection.getAutomaticStyles().addStyle(derivedStyle);
                return derivedStyle;
            }

            final OfficeStyle predefAuto =
                    predefCollection.getAutomaticStyles().getStyle(styleFamily,
                    styleName);
            if (predefAuto != null)
            {
                // handle an automatic style ..
                final OfficeStyle derivedStyle =
                        deriveAutomaticStyle(predefAuto, styleFamily, styleName,
                        generator, commonCollection, predefCollection);
                stylesCollection.getAutomaticStyles().addStyle(derivedStyle);
                return derivedStyle;
            }

            final OfficeStyle predefCommon =
                    predefCollection.getCommonStyles().getStyle(styleFamily, styleName);
            if (predefCommon != null)
            {
                // handle an common style ..
                final OfficeStyle derivedStyle =
                        deriveCommonStyle(predefCommon, styleFamily, styleName,
                        generator, commonCollection, predefCollection);
                stylesCollection.getAutomaticStyles().addStyle(derivedStyle);
                return derivedStyle;
            }
        }

        // No such style. Create a new one ..
        final OfficeStyle autostyle = new OfficeStyle();
        autostyle.setNamespace(OfficeNamespaces.STYLE_NS);
        autostyle.setType(STYLE);
        autostyle.setStyleFamily(styleFamily);
        if (styleName != null)
        {
            autostyle.setStyleName(styleName);
        }
        else
        {
            autostyle.setStyleName(generator.generateName("derived_anonymous"));
        }

        final OfficeStyles autoStyles = stylesCollection.getAutomaticStyles();
        autoStyles.addStyle(autostyle);
        return autostyle;
View Full Code Here

            final AttributeNameGenerator nameGenerator,
            final OfficeStylesCollection commonCollection,
            final OfficeStylesCollection predefCollection)
            throws ReportProcessingException
    {
        final OfficeStyle autostyle = new OfficeStyle();
        autostyle.setNamespace(OfficeNamespaces.STYLE_NS);
        autostyle.setType(STYLE);
        autostyle.setStyleFamily(styleFamily);
        autostyle.setStyleName(nameGenerator.generateName("derived_" + styleName));
        autostyle.setStyleParent(styleName);

        // now copy the common style ..
        final OfficeStyles commonStyles = commonCollection.getCommonStyles();
        if (!commonStyles.containsStyle(styleFamily, styleName))
        {
View Full Code Here

            final OfficeStylesCollection predefCollection)
            throws ReportProcessingException
    {
        try
        {
            final OfficeStyle autostyle = (OfficeStyle) commonStyle.clone();
            autostyle.setNamespace(OfficeNamespaces.STYLE_NS);
            autostyle.setType(STYLE);
            autostyle.setStyleFamily(styleFamily);
            autostyle.setStyleName(nameGenerator.generateName("derived_auto_" + styleName));


            final String parent = autostyle.getStyleParent();
            if (parent != null)
            {
                copyStyle(styleFamily, parent, commonCollection, commonCollection,
                        predefCollection);
            }
View Full Code Here

            return null;
        }
        final OfficeStyle[] styles = predefCollection.getAutomaticStyles().getAllStyles();
        for (int i = 0; i < styles.length; i++)
        {
            final OfficeStyle officeStyle = styles[i];
            if (officeStyle.getStyleFamily().equals(styleFamily))
            {
                final Element section = officeStyle.findFirstChild(OfficeNamespaces.STYLE_NS, sectionName);
                if (section != null)
                {
                    int j = 0;
                    for (; j < propertyNamespace.size(); j++)
                    {
View Full Code Here

        {
            return null;
        }
        seenStyles.add(styleName);

        final OfficeStyle style = predefCollection.getStyle(styleFamily, styleName);
        if (style == null)
        {
            return null; // no such style

        }
        final Element section = style.findFirstChild(OfficeNamespaces.STYLE_NS, sectionName);
        if (section != null)
        {
            final Object attribute = section.getAttribute(propertyNamespace, propertyName);
            if (attribute != null)
            {
                return String.valueOf(attribute);
            }
        }
        final String parent = style.getStyleParent();
        if (parent == null)
        {
            return null;
        }
        return queryStyle(predefCollection, styleFamily, parent, sectionName, propertyNamespace, propertyName, seenStyles);
View Full Code Here

        if (document == null)
        {
            return null;
        }

        final OfficeStyle style = document.getStylesCollection().getStyle("table-cell", cellStyleName);
        return (String) style.getAttribute(OfficeNamespaces.STYLE_NS, "data-style-name");
    }
View Full Code Here

    private final OfficeStyle officeStyle;
    private final List childs;

    public OfficeStyleReadHandler()
    {
        this.officeStyle = new OfficeStyle();
        this.childs = new ArrayList();
    }
View Full Code Here

    {
        final OfficeStyles commonStyles = stylesCollection.getCommonStyles();
        final OfficeStyle[] allCommonStyles = commonStyles.getAllStyles();
        for (int i = 0; i < allCommonStyles.length; i++)
        {
            final OfficeStyle style = allCommonStyles[i];
            autoStyleNameGenerator.generateName(style.getStyleName());
        }

        final OfficeStyles autoStyles = stylesCollection.getAutomaticStyles();
        final OfficeStyle[] allAutoStyles = autoStyles.getAllStyles();
        for (int i = 0; i < allAutoStyles.length; i++)
        {
            final OfficeStyle style = allAutoStyles[i];
            autoStyleNameGenerator.generateName(style.getStyleName());
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.star.report.pentaho.model.OfficeStyle

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.