Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc for Elexis version 2.1.7.dev vom 17.03.2013

ag.ion.bion.officelayer.internal.text
Class TextTable

java.lang.Object
  extended by ag.ion.bion.officelayer.text.AbstractTextComponent
      extended by ag.ion.bion.officelayer.internal.text.TextTable
All Implemented Interfaces:
ICloneServiceProvider, ITextComponent, ITextContent, ITextTable

public class TextTable
extends AbstractTextComponent
implements ITextTable

Table of an OpenOffice.org text document.


Field Summary
 
Fields inherited from class ag.ion.bion.officelayer.text.AbstractTextComponent
textDocument
 
Fields inherited from interface ag.ion.bion.officelayer.text.ITextTable
MAX_CELLS_IN_TABLE, MAX_COLUMNS_IN_TABLE
 
Constructor Summary
TextTable(ITextDocument textDocument, com.sun.star.text.XTextTable xTextTable)
          Constructs new TextTable.
 
Method Summary
 void addCellData(java.lang.String cellName, java.lang.String content)
          Adds submitted content to the cell with the submitted name.
 void addCellData(java.lang.String cellName, com.sun.star.text.XTextContent xTextContent)
          Adds submitted text content to the cell with the submitted name.
 void addColumn(int count)
          Adds column(s) to the table.
 void addColumn(int index, int count)
          Adds column(s) at submitted index the table.
 void addColumn(int index, int count, boolean after)
          Adds column(s) at submitted index the table.
 void addRow(int count)
          Adds row(s) to the table.
 void addRow(int index, int count)
          Adds row(s) at submitted index to the table.
 ITextTableCell getCell(int columnIndex, int rowIndex)
          Returns cell with the submitted column and row index.
 ITextTableCell getCell(java.lang.String name)
          Returns cell with the submitted name.
 ITextTableCellRange getCellRange(int firstColumnIndex, int firstRowIndex, int lastColumnIndex, int lastRowIndex)
          Returns cell range on the basis submitted index informations.
 ITextTableCellRange getCellRange(java.lang.String cellRangeName)
          Returns cell range on the basis of the submitted cell range name.
 ITextTableCell[] getCellsWithFormula()
          Returns all cells with formulas.
 ICloneService getCloneService()
          Gets the clone service of the element.
 ITextTableColumn getColumn(int index)
          Returns a column at submitted index the table.
 int getColumnCount()
          Returns number of available columns.
 ITextTableColumn[] getColumns()
          Returns all columns of a table.
 java.lang.String getName()
          Returns name of the table.
 ITextTableProperties getProperties()
          Returns properties of the text table.
 ITextTablePropertyStore getPropertyStore()
          Returns the property store of the table.
 ITextTableRow getRow(int index)
          Returns text table row.
 int getRowCount()
          Returns number of available rows.
 ITextTableRow[] getRows()
          Returns text table row.
 short getTableEndPageNumber()
          Returns the page number where the table ends, returns -1 if page number could not be determined.
 short getTableStartPageNumber()
          Returns the page number where the table starts, returns -1 if page number could not be determined.
 ITextRange getTextRange()
          Returns text range of the text table.
 com.sun.star.text.XTextContent getXTextContent()
          Returns OpenOffice.org XTextContent interface.
 com.sun.star.text.XTextTable getXTextTable()
          Returns OpenOffice.org XTextTable interface.
 void markTable()
          Marks the table.
 void remove()
          Removes the table.
 void removeRow(int index)
          Removes a specified row.
 void removeRows(int index, int count)
          Removes rows.
 void setCellData(java.lang.String cellName, double content)
          Sets data of the cell with the submitted name.
 void setCellData(java.lang.String cellName, java.lang.String content)
          Sets data of the cell with the submitted name.
 void setCellData(java.lang.String cellName, com.sun.star.text.XTextContent xTextContent)
          Sets data of cell with the submitted name.
 void setCellFormula(java.lang.String cellName, java.lang.String formula)
          Sets formula into the cell with the submitted name.
 void setHeaderRows(int headerRows)
          Sets the number of header rows to apply header style for.
 void spreadColumnsEvenly()
          Spread all columns evenly.
 void spreadColumnsEvenly(int startIndex, int endIndex)
          Spread columns in range evenly.
 
Methods inherited from class ag.ion.bion.officelayer.text.AbstractTextComponent
getTextDocument
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ag.ion.bion.officelayer.text.ITextComponent
getTextDocument
 

Constructor Detail

TextTable

public TextTable(ITextDocument textDocument,
                 com.sun.star.text.XTextTable xTextTable)
          throws com.sun.star.lang.IllegalArgumentException
Constructs new TextTable.

Parameters:
textDocument - text document to be used
xTextTable - OpenOffice.org XTextTable interface
Throws:
com.sun.star.lang.IllegalArgumentException - if the submitted text document or OpenOffice.org XTextTable interface is not valid
Method Detail

getXTextContent

public com.sun.star.text.XTextContent getXTextContent()
Returns OpenOffice.org XTextContent interface.

Specified by:
getXTextContent in interface ITextContent
Specified by:
getXTextContent in interface ITextTable
Returns:
OpenOffice.org XTextContent interface

getXTextTable

public com.sun.star.text.XTextTable getXTextTable()
Returns OpenOffice.org XTextTable interface.

Specified by:
getXTextTable in interface ITextTable
Returns:
OpenOffice.org XTextTable interface

getTextRange

public ITextRange getTextRange()
                        throws java.lang.Exception
Returns text range of the text table.

Specified by:
getTextRange in interface ITextTable
Returns:
text range of the text table
Throws:
java.lang.Exception

getProperties

public ITextTableProperties getProperties()
Returns properties of the text table.

Specified by:
getProperties in interface ITextTable
Returns:
properties of the text table

getName

public java.lang.String getName()
Returns name of the table.

Specified by:
getName in interface ITextTable
Returns:
name of the table

setCellData

public void setCellData(java.lang.String cellName,
                        com.sun.star.text.XTextContent xTextContent)
                 throws java.lang.Exception
Sets data of cell with the submitted name.

Parameters:
cellName - name of the cell
xTextContent - content to be inserted
Throws:
java.lang.Exception - if any error occurs

addCellData

public void addCellData(java.lang.String cellName,
                        com.sun.star.text.XTextContent xTextContent)
                 throws java.lang.Exception
Adds submitted text content to the cell with the submitted name.

Parameters:
cellName - name of the cell
xTextContent - text content to be added
Throws:
java.lang.Exception - if any error occurs

setCellData

public void setCellData(java.lang.String cellName,
                        java.lang.String content)
                 throws java.lang.Exception
Sets data of the cell with the submitted name.

Parameters:
cellName - name of the cell
content - content to be inserted
Throws:
java.lang.Exception - if any error occurs

addCellData

public void addCellData(java.lang.String cellName,
                        java.lang.String content)
                 throws java.lang.Exception
Adds submitted content to the cell with the submitted name.

Parameters:
cellName - name of the cell
content - content to be added
Throws:
java.lang.Exception - if any error occurs

setCellData

public void setCellData(java.lang.String cellName,
                        double content)
                 throws java.lang.Exception
Sets data of the cell with the submitted name.

Parameters:
cellName - name of the cell
content - content to be inserted
Throws:
java.lang.Exception - if any error occurs

setCellFormula

public void setCellFormula(java.lang.String cellName,
                           java.lang.String formula)
                    throws java.lang.Exception
Sets formula into the cell with the submitted name.

Parameters:
cellName - name of the cell
formula - formula to be inserted
Throws:
java.lang.Exception - if any error occurs

addRow

public void addRow(int count)
            throws TextException
Adds row(s) to the table.

Specified by:
addRow in interface ITextTable
Parameters:
count - number of rows to be added
Throws:
TextException - if the row(s) can not be added

addRow

public void addRow(int index,
                   int count)
            throws TextException
Adds row(s) at submitted index to the table.

Specified by:
addRow in interface ITextTable
Parameters:
index - index to be used
count - number of rows to be added
Throws:
TextException - if the row(s) can not be added

getRowCount

public int getRowCount()
Returns number of available rows.

Specified by:
getRowCount in interface ITextTable
Returns:
number of available rows.

addColumn

public void addColumn(int count)
               throws TextException
Adds column(s) to the table.

Specified by:
addColumn in interface ITextTable
Parameters:
count - number of columns to be added
Throws:
TextException - if the column(s) can not be added

addColumn

public void addColumn(int index,
                      int count)
               throws TextException
Adds column(s) at submitted index the table.

Specified by:
addColumn in interface ITextTable
Parameters:
index - index to be used
count - number of columns to be added
Throws:
TextException - if the column(s) can not be added

addColumn

public void addColumn(int index,
                      int count,
                      boolean after)
               throws TextException
Adds column(s) at submitted index the table.

Specified by:
addColumn in interface ITextTable
Parameters:
index - index to be used
count - number of columns to be added
after - true, if the rows shoud be addes after submitted index
Throws:
TextException - if the column(s) can not be added

getColumn

public ITextTableColumn getColumn(int index)
                           throws TextException
Returns a column at submitted index the table.

Specified by:
getColumn in interface ITextTable
Parameters:
index - index to be used
Returns:
column of a table
Throws:
TextException - if any error occurs

getColumns

public ITextTableColumn[] getColumns()
                              throws TextException
Returns all columns of a table.

Specified by:
getColumns in interface ITextTable
Returns:
columns of a table
Throws:
TextException - if any error occurs

getColumnCount

public int getColumnCount()
Returns number of available columns.

Specified by:
getColumnCount in interface ITextTable
Returns:
number of available columns

spreadColumnsEvenly

public void spreadColumnsEvenly()
                         throws TextException
Spread all columns evenly.

Specified by:
spreadColumnsEvenly in interface ITextTable
Throws:
TextException - if necessary properties are not available

spreadColumnsEvenly

public void spreadColumnsEvenly(int startIndex,
                                int endIndex)
                         throws TextException
Spread columns in range evenly.

Specified by:
spreadColumnsEvenly in interface ITextTable
Parameters:
startIndex - index of the first column in range
endIndex - index of the last column in range
Throws:
TextException - if necessary properties are not available

getCell

public ITextTableCell getCell(java.lang.String name)
                       throws TextException
Returns cell with the submitted name.

Specified by:
getCell in interface ITextTable
Parameters:
name - name of the cell
Returns:
cell with the submitted name
Throws:
TextException - if the cell is not available

getCellsWithFormula

public ITextTableCell[] getCellsWithFormula()
Returns all cells with formulas.

Specified by:
getCellsWithFormula in interface ITextTable
Returns:
cells with formulas

getCell

public ITextTableCell getCell(int columnIndex,
                              int rowIndex)
                       throws TextException
Returns cell with the submitted column and row index.

Specified by:
getCell in interface ITextTable
Parameters:
columnIndex - column index of the cell
rowIndex - row index of the cell
Returns:
cell with the submitted column and row index
Throws:
TextException - if the cell is not available

getCellRange

public ITextTableCellRange getCellRange(int firstColumnIndex,
                                        int firstRowIndex,
                                        int lastColumnIndex,
                                        int lastRowIndex)
                                 throws TextException
Returns cell range on the basis submitted index informations.

Specified by:
getCellRange in interface ITextTable
Parameters:
firstColumnIndex - index of first column inside the range
firstRowIndex - index of first row inside the range
lastColumnIndex - index of last column inside the range
lastRowIndex - index of last row inside the range
Returns:
cell range on the basis submitted index informations
Throws:
TextException - if the cell range is not available

getCellRange

public ITextTableCellRange getCellRange(java.lang.String cellRangeName)
                                 throws TextException
Returns cell range on the basis of the submitted cell range name.

Specified by:
getCellRange in interface ITextTable
Parameters:
cellRangeName - name of the cell range
Returns:
cell range on the basis of the submitted cell range name
Throws:
TextException - if the cell range is not available

getRows

public ITextTableRow[] getRows()
Returns text table row.

Specified by:
getRows in interface ITextTable
Returns:
text table row

getCloneService

public ICloneService getCloneService()
                              throws CloneException
Gets the clone service of the element.

Specified by:
getCloneService in interface ICloneServiceProvider
Returns:
the clone service
Throws:
CloneException - if the clone service could not be returned

getRow

public ITextTableRow getRow(int index)
Returns text table row.

Specified by:
getRow in interface ITextTable
Parameters:
index - index to be used
Returns:
text table row

getPropertyStore

public ITextTablePropertyStore getPropertyStore()
                                         throws TextException
Returns the property store of the table.

Specified by:
getPropertyStore in interface ITextTable
Returns:
store a property store of the table
Throws:
TextException - if the property store is not available

removeRow

public void removeRow(int index)
               throws TextException
Removes a specified row.

Specified by:
removeRow in interface ITextTable
Parameters:
index - index of the row
Throws:
TextException - if the row could not removed

removeRows

public void removeRows(int index,
                       int count)
                throws TextException
Removes rows.

Specified by:
removeRows in interface ITextTable
Parameters:
index - index of the first row
count - number of rows to remove
Throws:
TextException - if the rows could not removed

remove

public void remove()
            throws TextException
Removes the table.

Specified by:
remove in interface ITextTable
Throws:
TextException - if the table can not be removed

getTableStartPageNumber

public short getTableStartPageNumber()
Returns the page number where the table starts, returns -1 if page number could not be determined.

Specified by:
getTableStartPageNumber in interface ITextTable
Returns:
the page number where the table starts, returns -1 if page number could not be determined

setHeaderRows

public void setHeaderRows(int headerRows)
                   throws TextException
Sets the number of header rows to apply header style for. NOTE: Table must already be inserted before calling this method.

Specified by:
setHeaderRows in interface ITextTable
Parameters:
headerRows - number of header rows
Throws:
TextException - if the header rows could not be set

getTableEndPageNumber

public short getTableEndPageNumber()
Returns the page number where the table ends, returns -1 if page number could not be determined.

Specified by:
getTableEndPageNumber in interface ITextTable
Returns:
the page number where the table ends, returns -1 if page number could not be determined

markTable

public void markTable()
Marks the table.

Specified by:
markTable in interface ITextTable

Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc for Elexis version 2.1.7.dev vom 17.03.2013