Holger's
Java API

com.antelmann.ooffice
Class TextTableFrame

java.lang.Object
  extended by com.antelmann.ooffice.TextTableFrame
All Implemented Interfaces:
ThirdParty

public class TextTableFrame
extends Object
implements ThirdParty

provides easy to use table-related functionality for TextFrames This class implements ThirdParty for its use of OpenOffice libraries; see www.openoffice.org

Author:
Holger Antelmann

Constructor Summary
TextTableFrame(TextFrame doc)
           
 
Method Summary
 int appendRows(String tableName, int count)
          returns the number of rows in the given table including the appended rows
 void copyCellText(String originTableName, int originRow, int originColumn, String targetTableName, int targetRow, int targetColumn)
           
 void copyCellText(String originTableName, String originCellName, String targetTableName, String targetCellName)
           
 int deleteRows(String tableName, int atRow, int count)
          returns the number of rows in the given table including the inserted rows
 com.sun.star.table.XCell getCell(String tableName, int row, int column)
           
 com.sun.star.table.XCell getCellForBookmark(String bookmark)
           
 com.sun.star.table.XCell getCellForCursor(com.sun.star.text.XTextCursor cursor)
           
 String getCellNameFor(String bookmark)
           
 String getCellNameFor(com.sun.star.table.XCell cell)
           
 String[] getCellNamesFor(String tableName)
           
static int getRowForCellName(String cell)
          only works properly for simple cell names (without merged/splitted cells)
 String getTableNameFor(String bookmark)
           
 String getTableNameFor(com.sun.star.table.XCell cell)
           
 String[] getTableNames()
           
 TextFrame getTextFrame()
           
 com.sun.star.text.XText insertIntoCell(String tableName, int row, int column, String text)
          returns the text component of the target cell for further handling
 com.sun.star.text.XText insertIntoCell(String tableName, String cellName, String text)
          returns the text component of the target cell for further handling
 int insertRows(String tableName, int atRow, int count)
          returns the number of rows in the given table including the inserted rows
 int insertRowsAtBookmark(String bookmark, int count)
           
 void setCellBackground(com.sun.star.table.XCell cell, String imageURL)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextTableFrame

public TextTableFrame(TextFrame doc)
Method Detail

getTextFrame

public TextFrame getTextFrame()

deleteRows

public int deleteRows(String tableName,
                      int atRow,
                      int count)
               throws OfficeException
returns the number of rows in the given table including the inserted rows

Throws:
OfficeException

insertRows

public int insertRows(String tableName,
                      int atRow,
                      int count)
               throws OfficeException
returns the number of rows in the given table including the inserted rows

Throws:
OfficeException

appendRows

public int appendRows(String tableName,
                      int count)
               throws OfficeException
returns the number of rows in the given table including the appended rows

Throws:
OfficeException

getCellNamesFor

public String[] getCellNamesFor(String tableName)
                         throws OfficeException,
                                IllegalArgumentException
Throws:
OfficeException
IllegalArgumentException

getCellNameFor

public String getCellNameFor(com.sun.star.table.XCell cell)
                      throws OfficeException
Throws:
OfficeException

getTableNameFor

public String getTableNameFor(com.sun.star.table.XCell cell)
                       throws OfficeException
Throws:
OfficeException

getTableNames

public String[] getTableNames()

getRowForCellName

public static int getRowForCellName(String cell)
only works properly for simple cell names (without merged/splitted cells)


insertRowsAtBookmark

public int insertRowsAtBookmark(String bookmark,
                                int count)
                         throws OfficeException
Throws:
OfficeException

getTableNameFor

public String getTableNameFor(String bookmark)
                       throws OfficeException,
                              IllegalArgumentException
Throws:
OfficeException
IllegalArgumentException

getCellNameFor

public String getCellNameFor(String bookmark)
                      throws OfficeException,
                             IllegalArgumentException
Throws:
OfficeException
IllegalArgumentException

getCellForBookmark

public com.sun.star.table.XCell getCellForBookmark(String bookmark)
                                            throws OfficeException,
                                                   IllegalArgumentException
Throws:
OfficeException
IllegalArgumentException

getCellForCursor

public com.sun.star.table.XCell getCellForCursor(com.sun.star.text.XTextCursor cursor)
                                          throws OfficeException
Throws:
OfficeException

insertIntoCell

public com.sun.star.text.XText insertIntoCell(String tableName,
                                              String cellName,
                                              String text)
                                       throws OfficeException,
                                              IllegalArgumentException
returns the text component of the target cell for further handling

Throws:
OfficeException
IllegalArgumentException

getCell

public com.sun.star.table.XCell getCell(String tableName,
                                        int row,
                                        int column)
                                 throws OfficeException,
                                        IllegalArgumentException
Throws:
OfficeException
IllegalArgumentException

insertIntoCell

public com.sun.star.text.XText insertIntoCell(String tableName,
                                              int row,
                                              int column,
                                              String text)
                                       throws OfficeException,
                                              IllegalArgumentException
returns the text component of the target cell for further handling

Throws:
OfficeException
IllegalArgumentException

copyCellText

public void copyCellText(String originTableName,
                         int originRow,
                         int originColumn,
                         String targetTableName,
                         int targetRow,
                         int targetColumn)
                  throws OfficeException,
                         IllegalArgumentException
Throws:
OfficeException
IllegalArgumentException

copyCellText

public void copyCellText(String originTableName,
                         String originCellName,
                         String targetTableName,
                         String targetCellName)
                  throws OfficeException,
                         IllegalArgumentException
Throws:
OfficeException
IllegalArgumentException

setCellBackground

public void setCellBackground(com.sun.star.table.XCell cell,
                              String imageURL)
                       throws OfficeException
Throws:
OfficeException


(c) 2001-2006 Holger Antelmann - all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads