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

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


  {
    xmlWriter.writeTag
        (OfficeNamespaces.OFFICE_NS, "automatic-styles", XmlWriterSupport.OPEN);
    for (int sci = 0; sci < osc.length; sci++)
    {
      final OfficeStylesCollection collection = osc[sci];
      final OfficeStyles officeStyles = collection.getAutomaticStyles();
      writeStyles(officeStyles);
    }

    xmlWriter.writeCloseTag();
  }
View Full Code Here


        (OfficeNamespaces.OFFICE_NS, "font-face-decls", XmlWriterSupport.OPEN);

    final TreeMap fontFaces = new TreeMap();
    for (int sci = 0; sci < osc.length; sci++)
    {
      final OfficeStylesCollection collection = osc[sci];
      final FontFaceDeclsSection fontFaceDecls = collection.getFontFaceDecls();
      final FontFaceElement[] fontFaceElements = fontFaceDecls.getAllFontFaces();
      for (int i = 0; i < fontFaceElements.length; i++)
      {
        final FontFaceElement element = fontFaceElements[i];
        fontFaces.put (element.getStyleName(), element);
View Full Code Here

            // todo: Store the page-layouts as well.
            // The page layouts are derived from a common template, but as the
            // header-heights differ, we have to derive these beasts instead
            // of copying them

            final OfficeStylesCollection officeStylesCollection = getGlobalStylesCollection();
            final OfficeMasterStyles officeMasterStyles = officeStylesCollection.getMasterStyles();
            final String pageLayoutTemplate = currentMasterPage.getPageLayout();
            if (pageLayoutTemplate == null)
            {
                // there is no pagelayout. Create one ..
                final String derivedLayout = masterPageFactory.createPageStyle(getGlobalStylesCollection().getAutomaticStyles(), headerSize, footerSize);
View Full Code Here

        contentProcessingState = TextRawReportTarget.CP_SETUP;

        activePageContext.clear();
        activePageContext.push(new PageContext());

        final OfficeStylesCollection predefStyles = getPredefinedStylesCollection();
        masterPageFactory = new MasterPageFactory(predefStyles.getMasterStyles());

        predefStyles.getAutomaticStyles().addStyle(createVariablesStyle(true));
        predefStyles.getAutomaticStyles().addStyle(createVariablesStyle(false));
    }
View Full Code Here

        if (role == OfficeDocumentReportTarget.ROLE_TEMPLATE ||
                role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_HEADER ||
                role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_FOOTER)
        {
            // Start buffering with an dummy styles-collection, so that the global styles dont get polluted ..
            startBuffering(new OfficeStylesCollection(), true);
        }
        else if (role == OfficeDocumentReportTarget.ROLE_PAGE_HEADER)
        {
            startBuffering(getGlobalStylesCollection(), true);
            pageHeaderOnReportHeader = PageSection.isPrintWithReportHeader(attrs);
View Full Code Here

        if ( (role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_HEADER ||
              role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_FOOTER ) &&
            (!PageSection.isPrintWithReportHeader(attrs) ||
            !PageSection.isPrintWithReportFooter(attrs)) )
        {
            startBuffering(new OfficeStylesCollection(), true);
        }
        else
        {
            super.startReportSection(attrs, role);
        }
View Full Code Here

        }
    }

    private String generateInitialTableStyle() throws ReportProcessingException
    {
        final OfficeStylesCollection predefStyles = getPredefinedStylesCollection();
        final OfficeStyles commonStyles = predefStyles.getAutomaticStyles();
        if ( !commonStyles.containsStyle(OfficeToken.TABLE, "Initial_Table") )
        {
            final String masterPageName = createMasterPage();

            final OfficeStyle tableStyle = new OfficeStyle();
View Full Code Here

        return "Initial_Table";
    }

    private String createMasterPage() throws ReportProcessingException
    {
        final OfficeStylesCollection predefStyles = getPredefinedStylesCollection();
        final MasterPageFactory masterPageFactory = new MasterPageFactory(predefStyles.getMasterStyles());
        final OfficeMasterPage masterPage;
        if ( !masterPageFactory.containsMasterPage("Standard", null, null) )
        {
            masterPage = masterPageFactory.createMasterPage("Standard", null, null);

            final CSSNumericValue zeroLength = CSSNumericValue.createValue(CSSNumericType.CM, 0);
            final String pageLayoutTemplate = masterPage.getPageLayout();
            if ( pageLayoutTemplate == null )
            {
                // there is no pagelayout. Create one ..
                final String derivedLayout = masterPageFactory.createPageStyle(getGlobalStylesCollection().getAutomaticStyles(), zeroLength, zeroLength);
                masterPage.setPageLayout(derivedLayout);
            }
            else
            {
                final String derivedLayout = masterPageFactory.derivePageStyle(pageLayoutTemplate,
                    getPredefinedStylesCollection().getAutomaticStyles(),
                    getGlobalStylesCollection().getAutomaticStyles(), zeroLength, zeroLength);
                masterPage.setPageLayout(derivedLayout);
            }

            final OfficeStylesCollection officeStylesCollection = getGlobalStylesCollection();
            final OfficeMasterStyles officeMasterStyles = officeStylesCollection.getMasterStyles();
            officeMasterStyles.addMasterPage(masterPage);
        }
        else
        {
            masterPage = masterPageFactory.getMasterPage("Standard", null, null);
View Full Code Here

  private final OfficeStylesCollection officeStylesCollection;
  private FontFaceDeclsReadHandler fontFaceReadHandler;

  public DocumentStylesReadHandler()
  {
    officeStylesCollection = new OfficeStylesCollection();
  }
View Full Code Here

        {
            final ResourceKey key =
                    resourceManager.deriveKey(contextKey, "styles.xml");
            final Resource resource =
                    resourceManager.create(key, contextKey, OfficeStylesCollection.class);
            final OfficeStylesCollection styles =
                    (OfficeStylesCollection) resource.getResource();
            if (styles != null)
            {
                return styles;
            }
        }
        catch (ResourceKeyCreationException e)
        {
            // ignore ..
            LOGGER.debug("Failed to create resource-key for 'styles.xml'. Ignoring.", e);
        }
        catch (ResourceException e)
        {
            // ignore ..
            LOGGER.debug("Failed to parse resource for 'styles.xml'. Ignoring.", e);
        }

        return new OfficeStylesCollection();
    }
View Full Code Here

TOP

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

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.