public class OTable extends OEnumPropObj
| Modifier and Type | Class and Description |
|---|---|
static class |
OTable.Cell
A text table cell or spreadsheet cell.
|
static class |
OTable.CellNumberFormat
Enumeration for number formats, e.g., for the number 123 the SCIENTIFC
format is 123.00E+00.
|
class |
OTable.CellRange
A text table cell range.
|
| Constructor and Description |
|---|
OTable(OWriterDoc doc,
int numRows,
int numCols)
Constructs a centered table with top and bottom margins set to 500.
|
| Modifier and Type | Method and Description |
|---|---|
OTable.CellRange |
addTitleRow(java.lang.String title,
OStyle.Para style)
Adds a title row as the first row.
|
void |
centerCellContents()
Centers the contents of all cells in the table.
|
static int[] |
colRowFromAddr(java.lang.String addr)
Converts a table or sheet cell address to a column and row.
|
static java.lang.String |
columnNameFromNum(int number)
Converts a table column number to a table column name, e.g., 2 to B.
|
OTable.CellRange |
columnRange(int colNum)
Returns the cell range for a column.
|
void |
deleteColumnsRight(int atColNum,
int numCols)
Deletes one or more columns.
|
void |
deleteRowsBelow(int atRowNum,
int numRows)
Deletes one or more rows.
|
void |
indent(int leftRightMargin)
Indents the table by increasing the left and right margins.
|
void |
insertColumnsRight(int atColNum,
int numCols)
Inserts one or more columns.
|
void |
insertRowsBelow(int atRowNum,
int numRows)
Inserts one or more rows.
|
int |
numColumns()
Returns the number of columns.
|
int |
numRows()
Returns the number of rows.
|
OTable.CellRange |
rowRange(int rowNum)
Returns the cell range for a row.
|
OTable.CellRange |
tableRange()
Returns the cell range that encompasses all used cells in the table.
|
com.sun.star.text.XTextTable |
xGetXTable()
Gets the XTextTable object.
|
prop, prop, prop, prop, prop, prop, prop, prop, prop, prop, prop, prop, prop, prop, prop, prop, prop, prop, prop, prop, prop, prop, prop, setProp, setProp, setProp, setProp, setProp, setProp, setProp, setProp, setProp, setProp, setProp, setProp, setProp, setProp, setProp, setProp, setProp, setProp, setProp, setProp, setProp, setProp, setProplogProps, xGetPropSetpublic OTable(OWriterDoc doc, int numRows, int numCols) throws com.sun.star.uno.Exception
doc - the Writer documentnumRows - the number of rowsnumCols - the number of columnscom.sun.star.uno.Exceptionpublic int numRows()
public int numColumns()
public OTable.CellRange tableRange() throws com.sun.star.uno.Exception
com.sun.star.uno.Exceptionpublic OTable.CellRange rowRange(int rowNum) throws com.sun.star.uno.Exception
rowNum - the row numbercom.sun.star.uno.Exceptionpublic OTable.CellRange columnRange(int colNum) throws com.sun.star.uno.Exception
colNum - the column numbercom.sun.star.uno.Exceptionpublic void insertRowsBelow(int atRowNum,
int numRows)
atRowNum - the number of the row to insert belownumRows - the number of rows to insertpublic void deleteRowsBelow(int atRowNum,
int numRows)
atRowNum - the number of the first row to deletenumRows - the number of rows to deletepublic void insertColumnsRight(int atColNum,
int numCols)
atColNum - the number of the column to insert to the right ofnumCols - the number of columns to insertpublic void deleteColumnsRight(int atColNum,
int numCols)
atColNum - the number of the first column to deletenumCols - the number of columns to deletepublic OTable.CellRange addTitleRow(java.lang.String title, OStyle.Para style) throws com.sun.star.uno.Exception
title - the titlestyle - the paragraph style for the titlecom.sun.star.uno.Exceptionpublic void centerCellContents()
throws com.sun.star.uno.Exception
com.sun.star.uno.Exceptionpublic void indent(int leftRightMargin)
throws com.sun.star.uno.Exception
leftRightMargin - the margins sizecom.sun.star.uno.Exceptionpublic static java.lang.String columnNameFromNum(int number)
number - column number (first = 0)public static int[] colRowFromAddr(java.lang.String addr)
addr - address (e.g., C17)public com.sun.star.text.XTextTable xGetXTable()