public class Column extends Component
Column provides methods to get table cells that belong to this table column.
| Modifier and Type | Method and Description |
|---|---|
Cell |
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 Column |
getInstance(TableTableColumnElement colElement)
Get the
Column instance from the TableTableColumnElement instance. |
Column |
getNextColumn()
Get the next column of the current column.
|
TableTableColumnElement |
getOdfElement()
Return an instance of
TableTableColumnElement which represents this feature. |
Column |
getPreviousColumn()
Get the previous column of the current column.
|
Table |
getTable()
Get owner table of the current column.
|
double |
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(double width)
Set the width of the column (in Millimeter).
|
void |
setWidthWidthoutRelative(double width)
Set the width without any worry about that it fits, the caller has to care about this.
|
getComponentByElement, getOwnerDocument, registerComponent, unregisterComponentpublic static Column getInstance(TableTableColumnElement colElement)
Column instance from the TableTableColumnElement instance.
Each TableTableColumnElement instance has a one-to-one relationship to the a
Column instance.
colElement - the column element that need to get the corresponding Column
instanceColumn instance represent the specified column elementpublic Table getTable()
public double getWidth()
public void setWidthWidthoutRelative(double width)
Take care that you call before Table.setWidth(double)
width - public void setWidth(double 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.getOdfElement in class ComponentTableTableColumnElementpublic int getCellCount()
public Cell getCellByIndex(int index)
index - the cell index in this columnpublic Column getPreviousColumn()
public Column 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 © 2010–2018 Apache Software Foundation; Copyright © 2018–2020 The Document Foundation. All rights reserved.