public class OdfTableColumn extends Object
OdfTableColumn provides methods to get table cells that belong to this table column.
Modifier and Type | Method and Description |
---|---|
OdfTableCell |
getCellByIndex(int index)
Get a cell with a specific index.
|
int |
getCellCount()
Get the count of cells in this column.
|
int |
getColumnIndex()
Get the index of this column in the owner table.
|
OdfStyle |
getDefaultCellStyle()
Get the default cell style of this column.
|
static OdfTableColumn |
getInstance(TableTableColumnElement colElement)
Get the
OdfTableColumn instance from the TableTableColumnElement
instance. |
OdfTableColumn |
getNextColumn()
Get the next column of the current column.
|
TableTableColumnElement |
getOdfElement()
Return an instance of
TableTableColumnElement which represents this feature. |
OdfTableColumn |
getPreviousColumn()
Get the previous column of the current column.
|
OdfTable |
getTable()
Get owner table of the current column.
|
long |
getWidth()
Get the width of the column (in Millimeter).
|
boolean |
isOptimalWidth()
Returns if the column always keeps its optimal width.
|
void |
setDefaultCellStyle(OdfStyle style)
Set the default cell style to this column.
|
void |
setUseOptimalWidth(boolean isUseOptimalWidth)
Set if the column always keeps its optimal width.
|
void |
setWidth(long width)
Set the width of the column (in Millimeter).
|
public static OdfTableColumn getInstance(TableTableColumnElement colElement)
OdfTableColumn
instance from the TableTableColumnElement
instance.
Each TableTableColumnElement
instance has a one-to-one relationship to the a
OdfTableColumn
instance.
colElement
- the column element that need to get the corresponding OdfTableColumn
instanceOdfTableColumn
instance represent the specified column elementpublic OdfTable getTable()
public long getWidth()
public void setWidth(long width)
width
- the width that will be set to the column (in Millimeter).public boolean isOptimalWidth()
public void setUseOptimalWidth(boolean isUseOptimalWidth)
isUseOptimalWidth
- the flag that indicate column should keep its optimal width or notpublic TableTableColumnElement getOdfElement()
TableTableColumnElement
which represents this feature.TableTableColumnElement
public int getCellCount()
public OdfTableCell getCellByIndex(int index)
index
- the cell index in this columnpublic OdfTableColumn getPreviousColumn()
public OdfTableColumn getNextColumn()
public int getColumnIndex()
public void setDefaultCellStyle(OdfStyle style)
The style should already exist in this document.
This method is not recommended for text document cases. These is a style assigned to each cell in tables under text documents. So setting the default cell style to a column may not work.
style
- the cell style of the documentpublic OdfStyle getDefaultCellStyle()
Copyright © 2008–2018 Apache Software Foundation; Copyright © 2018–2020 The Document Foundation. All rights reserved.