Examples of SpreadsheetDocument


Examples of ag.ion.bion.officelayer.internal.spreadsheet.SpreadsheetDocument

    } else if (xServiceInfo
        .supportsService("com.sun.star.sheet.SpreadsheetDocument")) {
      XSpreadsheetDocument xSpreadsheetDocument = (XSpreadsheetDocument) UnoRuntime
          .queryInterface(XSpreadsheetDocument.class, xComponent);
      if (xSpreadsheetDocument != null) {
        SpreadsheetDocument document = new SpreadsheetDocument(
            xSpreadsheetDocument, intitialProperties);
        document.setServiceProvider(serviceProvider);
        return document;
      }
      return null;
    } else if (xServiceInfo
        .supportsService("com.sun.star.presentation.PresentationDocument")) {
      XPresentationSupplier presentationSupplier = (XPresentationSupplier) UnoRuntime
          .queryInterface(XPresentationSupplier.class, xComponent);
      if (presentationSupplier != null) {
        PresentationDocument document = new PresentationDocument(
            presentationSupplier, intitialProperties);
        document.setServiceProvider(serviceProvider);
        return document;
      }
      return null;
    } else if (xServiceInfo
        .supportsService("com.sun.star.drawing.DrawingDocument")) {
      XDrawPagesSupplier xDrawPagesSupplier = (XDrawPagesSupplier) UnoRuntime
          .queryInterface(XDrawPagesSupplier.class, xComponent);
      if (xDrawPagesSupplier != null) {
        DrawingDocument document = new DrawingDocument(
            xDrawPagesSupplier, intitialProperties);
        document.setServiceProvider(serviceProvider);
        return document;
      }
      return null;
    } else if (xServiceInfo
        .supportsService("com.sun.star.formula.FormulaProperties")) {
      XPropertySet xPropertySet = (XPropertySet) UnoRuntime
          .queryInterface(XPropertySet.class, xComponent);
      if (xPropertySet != null) {
        FormulaDocument document = new FormulaDocument(xPropertySet,
            intitialProperties);
        document.setServiceProvider(serviceProvider);
        return document;
      }
      return null;
    } else if (xServiceInfo
        .supportsService("com.sun.star.text.WebDocument")) {
      XTextDocument xTextDocument = (XTextDocument) UnoRuntime
          .queryInterface(XTextDocument.class, xComponent);
      if (xTextDocument != null) {
        WebDocument document = new WebDocument(xTextDocument,
            intitialProperties);
        document.setServiceProvider(serviceProvider);
        return document;
      }
      return null;
    } else if (xServiceInfo
        .supportsService("com.sun.star.text.GlobalDocument")) {
      XTextDocument xTextDocument = (XTextDocument) UnoRuntime
          .queryInterface(XTextDocument.class, xComponent);
      if (xTextDocument != null) {
        GlobalTextDocument document = new GlobalTextDocument(
            xTextDocument, intitialProperties);
        document.setServiceProvider(serviceProvider);
        return document;
      }
      return null;
    } else if (xServiceInfo
        .supportsService("com.sun.star.sdb.OfficeDatabaseDocument")) {
      XOfficeDatabaseDocument xOfficeDatabaseDocument = (XOfficeDatabaseDocument) UnoRuntime
          .queryInterface(XOfficeDatabaseDocument.class, xComponent);
      if (xOfficeDatabaseDocument != null) {
        DatabaseDocument document = new DatabaseDocument(
            xOfficeDatabaseDocument, intitialProperties);
        document.setServiceProvider(serviceProvider);
        return document;
      }
      return null;
    } else {
      return null;
View Full Code Here

Examples of br.net.woodstock.rockframework.document.spreadsheet.SpreadsheetDocument

  protected abstract Workbook getWorkbook(final InputStream inputStream) throws IOException;

  @Override
  public SpreadsheetDocument read(final InputStream inputStream) throws IOException {
    SpreadsheetDocument document = new SpreadsheetDocument();
    Workbook workbook = this.getWorkbook(inputStream);
    int numSheets = workbook.getNumberOfSheets();
    for (int sheetIndex = 0; sheetIndex < numSheets; sheetIndex++) {
      org.apache.poi.ss.usermodel.Sheet sheet = workbook.getSheetAt(sheetIndex);
      Sheet s = new Sheet(sheet.getSheetName());

      if (sheet.getPhysicalNumberOfRows() > 0) {
        int numRows = sheet.getLastRowNum();

        for (int rowIndex = 0; rowIndex <= numRows; rowIndex++) {
          org.apache.poi.ss.usermodel.Row row = sheet.getRow(rowIndex);
          this.handleRow(s, row);
        }
        document.getSheets().add(s);
      }
    }
    return document;
  }
View Full Code Here

Examples of br.net.woodstock.rockframework.office.spreadsheet.SpreadsheetDocument

  protected abstract Workbook getWorkbook(final InputStream inputStream) throws IOException;

  @Override
  public SpreadsheetDocument read(final InputStream inputStream) throws IOException {
    SpreadsheetDocument document = new SpreadsheetDocument();
    Workbook workbook = this.getWorkbook(inputStream);
    int numSheets = workbook.getNumberOfSheets();
    for (int sheetIndex = 0; sheetIndex < numSheets; sheetIndex++) {
      org.apache.poi.ss.usermodel.Sheet sheet = workbook.getSheetAt(sheetIndex);
      Sheet s = new Sheet(sheet.getSheetName());

      if (sheet.getPhysicalNumberOfRows() > 0) {
        int numRows = sheet.getLastRowNum();

        for (int rowIndex = 0; rowIndex <= numRows; rowIndex++) {
          org.apache.poi.ss.usermodel.Row row = sheet.getRow(rowIndex);
          this.handleRow(s, row);
        }
        document.getSheets().add(s);
      }
    }
    return document;
  }
View Full Code Here

Examples of integration.forms.SpreadsheetDocument

    /* ------------------------------------------------------------------ */
    private void prepareTestStep( boolean useSpreadsheetDocument ) throws com.sun.star.uno.Exception, java.lang.Exception
    {
        m_primaryForm = null;

        m_document = useSpreadsheetDocument ? new SpreadsheetDocument( m_orb ) : DocumentHelper.blankTextDocument( m_orb );
        m_formLayer = new FormLayer( m_document );
    }
View Full Code Here

Examples of integration.forms.SpreadsheetDocument

    /* ------------------------------------------------------------------ */
    public static DocumentHelper blankDocument( XMultiServiceFactory orb, DocumentType eType ) throws com.sun.star.uno.Exception
    {
        XComponent document = implCreateBlankDocument( orb, getDocumentFactoryURL( eType ) );
        if ( eType == DocumentType.CALC )
            return new SpreadsheetDocument( orb, document );
        return new DocumentHelper( orb, document );
    }
View Full Code Here

Examples of integration.forms.SpreadsheetDocument

    /* ------------------------------------------------------------------ */
    private void prepareTestStep( boolean useSpreadsheetDocument ) throws com.sun.star.uno.Exception, java.lang.Exception
    {
        m_primaryForm = null;

        m_document = useSpreadsheetDocument ? new SpreadsheetDocument( m_orb ) : DocumentHelper.blankTextDocument( m_orb );
        m_formLayer = new FormLayer( m_document );
    }
View Full Code Here

Examples of integration.forms.SpreadsheetDocument

    /* ------------------------------------------------------------------ */
    private void prepareTestStep( boolean useSpreadsheetDocument ) throws com.sun.star.uno.Exception, java.lang.Exception
    {
        m_primaryForm = null;

        m_document = useSpreadsheetDocument ? new SpreadsheetDocument( m_orb ) : DocumentHelper.blankTextDocument( m_orb );
        m_formLayer = new FormLayer( m_document );
    }
View Full Code Here

Examples of integration.forms.SpreadsheetDocument

    /* ------------------------------------------------------------------ */
    private void prepareTestStep( boolean useSpreadsheetDocument ) throws com.sun.star.uno.Exception, java.lang.Exception
    {
        m_primaryForm = null;

        m_document = useSpreadsheetDocument ? new SpreadsheetDocument( m_orb ) : DocumentHelper.blankTextDocument( m_orb );
        m_formLayer = new FormLayer( m_document );
    }
View Full Code Here

Examples of org.odftoolkit.simple.SpreadsheetDocument

  public void testSetBorders() {
    try {
     
        Border borderbase = new Border(Color.LIME, 1.0701, 0.0208, 0.0346, SupportedLinearMeasure.CM);
      borderbase.setLineStyle(StyleTypeDefinitions.LineType.SINGLE);
      SpreadsheetDocument doc = SpreadsheetDocument.newSpreadsheetDocument();
      Table table = doc.getTableByName("Sheet1");
     
      Cell cell = table.getCellByPosition(2, 2);
      cell.setBorders(CellBordersType.BOTTOM, borderbase);
      cell.setBorders(CellBordersType.RIGHT, borderbase);
      cell.setBorders(CellBordersType.DIAGONALTLBR, borderbase);

      //verification
      Border base = cell.getBorder(CellBordersType.BOTTOM);
      base = cell.getBorder(CellBordersType.RIGHT);
      base = cell.getBorder(CellBordersType.DIAGONALTLBR);
      Assert.assertEquals(borderbase, base);
      Assert.assertEquals(StyleTypeDefinitions.LineType.SINGLE, borderbase.getLineStyle());
     
      //save
      doc.save(ResourceUtilities.newTestOutputFile("testSupportedLinearMeasure.ods"));
    } catch (Exception e) {
      LOGGER.log(Level.SEVERE, e.getMessage(), e);
      Assert.fail(e.getMessage());
    }
  }
View Full Code Here

Examples of org.odftoolkit.simple.SpreadsheetDocument

  public void testSetBorders_NONE() {
    try {
     
        Border borderbase = new Border(Color.LIME, 3.0701, 0.0208, 0.0346, SupportedLinearMeasure.CM);
      borderbase.setLineStyle(StyleTypeDefinitions.LineType.SINGLE);
      SpreadsheetDocument doc = SpreadsheetDocument.newSpreadsheetDocument();
      Table table = doc.getTableByName("Sheet1");
     
      Cell cell = table.getCellByPosition(0, 0);
      //cell.setBorders(CellBordersType.DIAGONAL_LINES, borderbase);
      cell.setBorders(CellBordersType.RIGHT, borderbase);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.