Package ag.ion.bion.officelayer.text

Examples of ag.ion.bion.officelayer.text.ITextTable


   *
   * @author Markus Kr�ger
   */
  private IClonedObject clonePreprocessor (IDestinationPosition position, boolean adoptContent, boolean generateReturnValue, PropertyKeysContainer propertyKeysContainer) throws CloneException {
    ITextTable[] textTables = textTable.getTextTableManagement().getTextTables();
    ITextTable table = (ITextTable)textTables[0].getCloneService().cloneToPosition(position,adoptContent,propertyKeysContainer).getClonedObject();
    ETextTable eTextTable = new ETextTable(textDocument,table);
   
    for(int i = 1; i < textTables.length; i++) {
      IDestinationPosition destinationPosition = new DestinationPosition(table);
      table = (ITextTable)textTables[i].getCloneService().cloneToPosition(destinationPosition,propertyKeysContainer);
View Full Code Here


  private IClonedObject clonePreprocessor (IDestinationPosition position, boolean adoptContent, boolean generateReturnValue, PropertyKeysContainer propertyKeysContainer) throws CloneException {
    try {
      ITextTableCellRange[] textTableCellRanges = textTableCellRange.getRanges();
      ITextTableCellRange[] range = new ITextTableCellRange[textTableCellRanges.length];
      range[0] = (ITextTableCellRange)textTableCellRanges[0].getCloneService().cloneToPosition(position,adoptContent,propertyKeysContainer).getClonedObject();
      ITextTable table = range[0].getCell(0,0).getTextTable();
      ETextTable eTextTable = new ETextTable(textDocument,table);
      for(int i = 1; i < textTableCellRanges.length; i++) {
        IDestinationPosition destinationPosition = new DestinationPosition(table);
        range[i] = (ITextTableCellRange)textTableCellRanges[i].getCloneService().cloneToPosition(destinationPosition,propertyKeysContainer).getClonedObject();
        table = range[i].getCell(0,0).getTextTable();
View Full Code Here

      TextTableCellReference textTableCellReference = null;

      int startTableIndex = textTable.getTextTableIndex(startCell.getTableCell().getTextTable());
      int endTableIndex = textTable.getTextTableIndex(endCell.getTableCell().getTextTable());
     
      ITextTable table = textTable.getTextTable(startTableIndex);
      if(!startCell.getName().getName().equals(endCell.getName().getName())) {
     
        if(startTableIndex != endTableIndex) {
          formula = table.getName()+ "." + startCell.getTableCell().getName().getName() + ":" + table.getCell(endColumnIndex,table.getRowCount()-1).getName().getName();
          textTableCellReference = new TextTableCellReference(formula);
          newTextTableCellReferences.add(textTableCellReference);
          for(int j = startTableIndex+1; j < endTableIndex; j++) {
            table = textTable.getTextTable(j);
            formula = table.getName()+"." +TextTableCellNameHelper.getColumnCharacter(startCell.getName().getColumnIndex()) + "1" + ":" + table.getCell(endColumnIndex,table.getRowCount()-1).getName().getName();
            textTableCellReference = new TextTableCellReference(formula);
            newTextTableCellReferences.add(textTableCellReference);
          }
         
          table = textTable.getTextTable(endTableIndex);
          formula = table.getName()+"." + TextTableCellNameHelper.getColumnCharacter(startCell.getName().getColumnIndex()) + "1" + ":" + endCell.getTableCell().getName().getName();
        }
        else {
          formula = table.getName()+"." + startCell.getTableCell().getName().getName() + ":" + endCell.getTableCell().getName().getName();
        }
      }
      else {
        formula = table.getName() + "." + startCell.getTableCell().getName().getName();
      }
      textTableCellReference = new TextTableCellReference(formula);
      newTextTableCellReferences.add(textTableCellReference);
     
      TextTableCellReference[] references = new TextTableCellReference[newTextTableCellReferences.size()];
View Full Code Here

      localOfficeApplicationConfiguration.setApplicationHomePath("d:\\Programme\\OpenOffice.org1.1.3");
      officeApplication.setConfiguration(localOfficeApplicationConfiguration);
      officeApplication.activate();
      docu = (ITextDocument)officeApplication.getDocumentService().loadDocument("file:///d:/java/eclipse/workspace/officeapi/test/testETables.sxw");
     
      ITextTable table = docu.getTextTableService().getTextTables()[0];
      ETextTable textTable = new ETextTable(docu,table);
     
      textTable.addRows(200); //o.k.
     
      textTable.getCell(10,1).setCellFormula("<A100>+<B3>");
View Full Code Here

      IPageStyle pageStyle = page.getPageStyle();
      IPageStyleProperties pageStyleProperties = pageStyle.getProperties();
      boolean value = pageStyleProperties.getIsLandscape();
      Assert.assertEquals(false, value);
     
      ITextTable textTable = textDocument.getTextTableService().constructTextTable(5, 15);
      textDocument.getTextService().getTextContentService().insertTextContent(textTable);
      page = pageService.getPage(0);
      pageStyle = page.getPageStyle();
      pageStyleProperties = pageStyle.getProperties();
      value = pageStyleProperties.getIsLandscape();
View Full Code Here

   * @throws TextException if the table could not be removed
   *
   * @author Miriam Sutter
   */
  public void removeTextTable(int index, ITextDocument textDocument) throws TextException{
    ITextTable textTable = (ITextTable)textTablesByIndex.get(index);
    textTable.remove();
    textTablesByIndex.remove(index);
    textTablesByName.remove(textTable.getName());
  }
View Full Code Here

      configuration.setApplicationHomePath("d:\\Programme\\OpenOffice.org1.1.3");
      localOfficeApplication.setConfiguration(configuration);
      localOfficeApplication.activate();
      ITextDocument textDocument = (ITextDocument)localOfficeApplication.getDocumentService().constructNewDocument(IDocument.WRITER, new DocumentDescriptor());
     
      ITextTable textTable = textDocument.getTextTableService().constructTextTable(5, 15);
      textDocument.getTextService().getTextContentService().insertTextContent(textTable);
     
      ITextTableProperties tableProperties = textTable.getProperties();
      tableProperties.getCellWidths();
     
     
    }
    catch(Exception exception) {
View Full Code Here

   */
  private IClonedObject clonePreprocessor (IDestinationPosition position, boolean adoptContent, boolean generateReturnValue, PropertyKeysContainer propertyKeysContainer) throws CloneException {
    try {
      if(cellCloneServices == null)
        getCloneCells();
      ITextTable newTable = null;
      if(oldTable == null)
        oldTable = textTableCellRange.getCell(0,0).getTextTable();
      if(textTablePropertyStore == null) {
        textTablePropertyStore = oldTable.getPropertyStore();
      }
      int columnStart = 0;
      int rowStart = 0;
      if(cellCloneServices.length == 0 ) {
        CloneException cloneException =  new CloneException("No range selected.");
        throw cloneException;
      }
      int columnArrayLength = cellCloneServices[0].length;
     
      if(position.getType() == null) {
        CloneException cloneException =  new CloneException("No valid type for the position.");
        throw cloneException;
      }
     
      if(ITextRange.class.isAssignableFrom(position.getType())) {
        ITextRange range = (ITextRange)position.getDestinationObject();
        if(textTableService == null)
          textTableService = textDocument.getTextTableService();
        newTable = (ITextTable)textTableService.constructTextTable(rowCount, columnCount);
        newTable.getProperties().setRepeatHeadline(textTablePropertyStore.repeatHeadline());
        if(textContentService == null)
          textContentService = textDocument.getTextService().getTextContentService();
        if (range != null) {
          textContentService.insertTextContent(range,newTable);
          newTable.getProperties().setTableColumnSeparators(textTablePropertyStore.getTableColumnSeparators());
        }
        else {
          CloneException cloneException =  new CloneException("No destination selected..");
          throw cloneException;
        }
      }
      else if(ITextTable.class.isAssignableFrom(position.getType())) {
        ITextTable range = (ITextTable)position.getDestinationObject();
        TextTableService tableService = new TextTableService(textDocument);

        newTable = (ITextTable)tableService.constructTextTable(rowCount, columnCount);
        newTable.getProperties().setRepeatHeadline(textTablePropertyStore.repeatHeadline());
       
View Full Code Here

   * @author ???
   * @author Markus Kr�ger
   */
  private void addRowsProperty(int count, ITextTableCellRange textTableCellRangeClone) throws TextException {
    try {
      ITextTable textTableLast = textTableManagement.getLastTextTable();
      int singleTableRowCount = textTableLast.getRowCount();
      if((singleTableRowCount + count) * columnCount <= ITextTable.MAX_CELLS_IN_TABLE) {
        textTableLast.addRow(count);
      }
      else {
        ITextTableCellRange textTableCellRangeHeaderClone = textTableLast.getCellRange(0,0,columnCount-1,0);
        int helpRows = maxRowsInTable-singleTableRowCount;
        if(helpRows > 0) {
          textTableLast.addRow(helpRows);
        }
        int helpCount = count-helpRows;
        while(helpCount > 0) {
          int insert = helpCount;
          TextTablePropertyStore tablePropertyStore = new TextTablePropertyStore(textTableManagement.getFirstTextTable());
          if(tablePropertyStore.repeatHeadline()) {
            insert = insert + 1;
          }
          if(helpCount * columnCount > ITextTable.MAX_CELLS_IN_TABLE) {
            insert = maxRowsInTable;
          }
          ITextTable textTable = textDocument.getTextTableService().constructTextTable(1,columnCount);
          ITextTableProperties properties = textTable.getProperties();
          properties.setRepeatHeadline(tablePropertyStore.repeatHeadline());
          textDocument.getTextService().getTextContentService().insertTextContentAfter(textTable,textTableLast);
          properties.setTableColumnSeparators(tablePropertyStore.getTableColumnSeparators());
          IDestinationPosition destinationPosition = new DestinationPosition(textTable.getCell("A1"));
          if(tablePropertyStore.repeatHeadline()) {
            textTableCellRangeHeaderClone.getCloneService().cloneToPositionNoReturn(destinationPosition,null);
            destinationPosition = new DestinationPosition(textTable.getCell("A2"));
            textTableCellRangeClone.getCloneService().cloneToPositionNoReturn(destinationPosition,false,null);
          }
          else {
            textTableCellRangeClone.getCloneService().cloneToPositionNoReturn(destinationPosition,false,null);
          }
          textTable.addRow(insert-1);
          textTableManagement.addTextTable(textTable);
          helpCount = helpCount-insert;
        }
      }
    }
View Full Code Here

    if(textTableManagement.getTextTables().length == 1 && textTableManagement.getFirstTextTable().getRowCount() + count < maxRowsInTable) {
      textTableManagement.getFirstTextTable().addRow(index,count);
      return;
    }
    IETextTableCellRange textTableCellRange = getCellRange(0,index,columnCount-1,getRowCount()-1);
    ITextTable textTable = textTableManagement.getLastTextTable();
    IDestinationPosition destinationPosition = new DestinationPosition(textTable);
   
    try {
      ETextTableCellRange tableCellRange = (ETextTableCellRange)textTableCellRange.getCloneService().cloneToPosition(destinationPosition,null).getClonedObject();
      ITextTableCellRange[] textTableCellRanges = tableCellRange.getRanges();
      int tableNumber = getTableNumber(index);
      ITextTable table = textTableManagement.getTextTable(tableNumber);
     
      int rowCount = table.getRowCount()-1;
      int rowIndex = getRowIndexInTable(tableNumber,index);
     
      removeTables(tableNumber+1,textTableManagement.getTextTables().length-tableNumber-1);
     
      ITextTableCellRange textTableCellRangeClone = table.getCellRange(0,rowIndex,columnCount-1,rowIndex);
     
      int help = rowIndex + count - (rowCount+1);
      if(help < 0) {
        for(int i = rowIndex; i <= count; i++) {
          ITextTableCellRange cellRange = table.getCellRange(0,i,columnCount-1,i);
          destinationPosition = new DestinationPosition(cellRange);
          textTableCellRangeClone.getCloneService().cloneToPosition(destinationPosition,null);
        }
        IETextTableCellRange cellRange = getCellRange(0,index,columnCount-1,index+count-1);
        clearTableRange(cellRange);
        table.removeRows(rowIndex+count,rowCount-(rowIndex+count)+1);
      }
      else {
        for(int i = rowIndex; i <= rowCount; i++) {
          ITextTableCellRange cellRange = table.getCellRange(0,i,columnCount-1,i);
          destinationPosition = new DestinationPosition(cellRange);
          textTableCellRangeClone.getCloneService().cloneToPosition(destinationPosition,null);
        }
        IETextTableCellRange cellRange = getCellRange(0,index,columnCount-1,index + (rowCount-rowIndex));
        clearTableRange(cellRange);
View Full Code Here

TOP

Related Classes of ag.ion.bion.officelayer.text.ITextTable

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.