Package org.apache.poi.xslf.usermodel
Class XSLFTable
- java.lang.Object
-
- org.apache.poi.xslf.usermodel.XSLFShape
-
- org.apache.poi.xslf.usermodel.XSLFGraphicFrame
-
- org.apache.poi.xslf.usermodel.XSLFTable
-
- All Implemented Interfaces:
Iterable<XSLFTableRow>
,GraphicalFrame<XSLFShape,XSLFTextParagraph>
,PlaceableShape<XSLFShape,XSLFTextParagraph>
,Shape<XSLFShape,XSLFTextParagraph>
,TableShape<XSLFShape,XSLFTextParagraph>
public class XSLFTable extends XSLFGraphicFrame implements Iterable<XSLFTableRow>, TableShape<XSLFShape,XSLFTextParagraph>
Represents a table in a .pptx presentation
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.poi.xslf.usermodel.XSLFShape
XSLFShape.ReparseFactory<T extends XmlObject>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addColumn()
Add a new column at the end of the table.XSLFTableRow
addRow()
XSLFTableCell
getCell(int row, int col)
double
getColumnWidth(int idx)
org.openxmlformats.schemas.drawingml.x2006.main.CTTable
getCTTable()
int
getNumberOfColumns()
int
getNumberOfRows()
double
getRowHeight(int row)
List<XSLFTableRow>
getRows()
protected XSLFTableStyle
getTableStyle()
Get assigned TableStylevoid
insertColumn(int colIdx)
Insert a new column at the given index.XSLFTableRow
insertRow(int rowIdx)
Insert a new row at the given index.Iterator<XSLFTableRow>
iterator()
void
mergeCells(int firstRow, int lastRow, int firstCol, int lastCol)
Merge cells of a tablevoid
removeColumn(int colIdx)
Remove the column at the given index.void
removeRow(int rowIdx)
Remove the row on the given indexvoid
setColumnWidth(int idx, double width)
void
setRowHeight(int row, double height)
void
updateCellAnchor()
Calculates the bounding boxes of all cells and updates the dimension of the table-
Methods inherited from class org.apache.poi.xslf.usermodel.XSLFGraphicFrame
getAnchor, getChart, getFallbackPicture, getFlipHorizontal, getFlipVertical, getRotation, getShapeType, hasChart, hasDiagram, setAnchor, setFlipHorizontal, setFlipVertical, setRotation
-
Methods inherited from class org.apache.poi.xslf.usermodel.XSLFShape
draw, fetchShapeProperty, getBgPr, getBgRef, getChild, getCNvPr, getFillPaint, getGrpSpPr, getParent, getPlaceholder, getPlaceholderDetails, getShapeId, getShapeName, getShapeProperties, getSheet, getSpStyle, getXmlObject, isPlaceholder, selectPaint, selectPaint, selectPaint, selectPaint, selectPaint, selectPaint, selectProperty, setParent, setPlaceholder
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface org.apache.poi.sl.usermodel.PlaceableShape
getAnchor, getFlipHorizontal, getFlipVertical, getParent, getRotation, getSheet, setAnchor, setFlipHorizontal, setFlipVertical, setRotation
-
Methods inherited from interface org.apache.poi.sl.usermodel.Shape
draw, getAnchor, getParent, getShapeId, getShapeName, getSheet
-
-
-
-
Method Detail
-
getCell
public XSLFTableCell getCell(int row, int col)
- Specified by:
getCell
in interfaceTableShape<XSLFShape,XSLFTextParagraph>
-
getCTTable
@Internal public org.openxmlformats.schemas.drawingml.x2006.main.CTTable getCTTable()
-
getNumberOfColumns
public int getNumberOfColumns()
- Specified by:
getNumberOfColumns
in interfaceTableShape<XSLFShape,XSLFTextParagraph>
-
getNumberOfRows
public int getNumberOfRows()
- Specified by:
getNumberOfRows
in interfaceTableShape<XSLFShape,XSLFTextParagraph>
-
getColumnWidth
public double getColumnWidth(int idx)
- Specified by:
getColumnWidth
in interfaceTableShape<XSLFShape,XSLFTextParagraph>
-
setColumnWidth
public void setColumnWidth(int idx, double width)
- Specified by:
setColumnWidth
in interfaceTableShape<XSLFShape,XSLFTextParagraph>
-
getRowHeight
public double getRowHeight(int row)
- Specified by:
getRowHeight
in interfaceTableShape<XSLFShape,XSLFTextParagraph>
-
setRowHeight
public void setRowHeight(int row, double height)
- Specified by:
setRowHeight
in interfaceTableShape<XSLFShape,XSLFTextParagraph>
-
iterator
public Iterator<XSLFTableRow> iterator()
- Specified by:
iterator
in interfaceIterable<XSLFTableRow>
-
getRows
public List<XSLFTableRow> getRows()
-
addRow
public XSLFTableRow addRow()
-
insertRow
public XSLFTableRow insertRow(int rowIdx)
Insert a new row at the given index.- Parameters:
rowIdx
- the row index.- Since:
- POI 5.0.0
-
removeRow
public void removeRow(int rowIdx)
Remove the row on the given index- Parameters:
rowIdx
- the row index
-
addColumn
public void addColumn()
Add a new column at the end of the table.- Since:
- POI 4.1.2
-
insertColumn
public void insertColumn(int colIdx)
Insert a new column at the given index.- Parameters:
colIdx
- the column index.- Since:
- POI 4.1.2
-
removeColumn
public void removeColumn(int colIdx)
Remove the column at the given index.- Parameters:
colIdx
- the column index.- Since:
- POI 4.1.2
-
mergeCells
public void mergeCells(int firstRow, int lastRow, int firstCol, int lastCol)
Merge cells of a table
-
getTableStyle
protected XSLFTableStyle getTableStyle()
Get assigned TableStyle- Returns:
- the assigned TableStyle
- Since:
- POI 3.15-beta2
-
updateCellAnchor
public void updateCellAnchor()
Calculates the bounding boxes of all cells and updates the dimension of the table
-
-