CellFormat
Inheritance: java.lang.Object
public class CellFormat
Represents all formatting for a table cell.
To learn more, visit the Working with Tables documentation article.
Methods
Method | Description |
---|---|
clearFormatting() | Resets to default cell formatting. |
equals(Object arg0) | |
fetchInheritedBorderAttr(int key) | |
fetchInheritedShadingAttr(int key) | |
getBorders() | Gets collection of borders of the cell. |
getBottomPadding() | Gets the amount of space (in points) to add below the contents of cell. |
getClass() | |
getDirectBorderAttr(int key) | |
getFitText() | If true , fits text in the cell, compressing each paragraph to the width of the cell. |
getHorizontalMerge() | Specifies how the cell is merged horizontally with other cells in the row. |
getLeftPadding() | Gets the amount of space (in points) to add to the left of the contents of cell. |
getOrientation() | Gets the orientation of text in a table cell. |
getPreferredWidth() | Gets the preferred width of the cell. |
getRightPadding() | Gets the amount of space (in points) to add to the right of the contents of cell. |
getShading() | Returns a Shading object that refers to the shading formatting for the cell. |
getTopPadding() | Gets the amount of space (in points) to add above the contents of cell. |
getVerticalAlignment() | Gets the vertical alignment of text in the cell. |
getVerticalMerge() | Specifies how the cell is merged with other cells vertically. |
getWidth() | Gets the width of the cell in points. |
getWrapText() | If true , wrap text for the cell. |
hashCode() | |
notify() | |
notifyAll() | |
setBorderAttr(int key, Object value) | |
setBottomPadding(double value) | Sets the amount of space (in points) to add below the contents of cell. |
setFitText(boolean value) | If true , fits text in the cell, compressing each paragraph to the width of the cell. |
setHorizontalMerge(int value) | Specifies how the cell is merged horizontally with other cells in the row. |
setLeftPadding(double value) | Sets the amount of space (in points) to add to the left of the contents of cell. |
setOrientation(int value) | Sets the orientation of text in a table cell. |
setPaddings(double leftPadding, double topPadding, double rightPadding, double bottomPadding) | Sets the amount of space (in points) to add to the left/top/right/bottom of the contents of cell. |
setPreferredWidth(PreferredWidth value) | Sets the preferred width of the cell. |
setRightPadding(double value) | Sets the amount of space (in points) to add to the right of the contents of cell. |
setTopPadding(double value) | Sets the amount of space (in points) to add above the contents of cell. |
setVerticalAlignment(int value) | Sets the vertical alignment of text in the cell. |
setVerticalMerge(int value) | Specifies how the cell is merged with other cells vertically. |
setWidth(double value) | Gets the width of the cell in points. |
setWrapText(boolean value) | If true , wrap text for the cell. |
toString() | |
wait() | |
wait(long arg0) | |
wait(long arg0, int arg1) |
clearFormatting()
public void clearFormatting()
Resets to default cell formatting. Does not change the width of the cell.
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | java.lang.Object |
Returns: boolean
fetchInheritedBorderAttr(int key)
public Object fetchInheritedBorderAttr(int key)
Parameters:
Parameter | Type | Description |
---|---|---|
key | int |
Returns: java.lang.Object
fetchInheritedShadingAttr(int key)
public Object fetchInheritedShadingAttr(int key)
Parameters:
Parameter | Type | Description |
---|---|---|
key | int |
Returns: java.lang.Object
getBorders()
public BorderCollection getBorders()
Gets collection of borders of the cell.
Returns: BorderCollection - Collection of borders of the cell.
getBottomPadding()
public double getBottomPadding()
Gets the amount of space (in points) to add below the contents of cell.
Returns: double - The amount of space (in points) to add below the contents of cell.
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class>
getDirectBorderAttr(int key)
public Object getDirectBorderAttr(int key)
Parameters:
Parameter | Type | Description |
---|---|---|
key | int |
Returns: java.lang.Object
getFitText()
public boolean getFitText()
If true , fits text in the cell, compressing each paragraph to the width of the cell.
Returns: boolean - The corresponding boolean value.
getHorizontalMerge()
public int getHorizontalMerge()
Specifies how the cell is merged horizontally with other cells in the row.
Returns: int - The corresponding int value. The returned value is one of CellMerge constants.
getLeftPadding()
public double getLeftPadding()
Gets the amount of space (in points) to add to the left of the contents of cell.
Returns: double - The amount of space (in points) to add to the left of the contents of cell.
getOrientation()
public int getOrientation()
Gets the orientation of text in a table cell.
Returns: int - The orientation of text in a table cell. The returned value is one of TextOrientation constants.
getPreferredWidth()
public PreferredWidth getPreferredWidth()
Gets the preferred width of the cell.
The preferred width (along with the table’s Auto Fit option) determines how the actual width of the cell is calculated by the table layout algorithm. Table layout can be performed by Aspose.Words when it saves the document or by Microsoft Word when it displays the document.
The preferred width can be specified in points or in percent. The preferred width can also be specified as “auto”, which means no preferred width is specified.
The default value is PreferredWidth.AUTO.
Returns: PreferredWidth - The preferred width of the cell.
getRightPadding()
public double getRightPadding()
Gets the amount of space (in points) to add to the right of the contents of cell.
Returns: double - The amount of space (in points) to add to the right of the contents of cell.
getShading()
public Shading getShading()
Returns a Shading object that refers to the shading formatting for the cell.
Returns: Shading - A Shading object that refers to the shading formatting for the cell.
getTopPadding()
public double getTopPadding()
Gets the amount of space (in points) to add above the contents of cell.
Returns: double - The amount of space (in points) to add above the contents of cell.
getVerticalAlignment()
public int getVerticalAlignment()
Gets the vertical alignment of text in the cell.
Returns: int - The vertical alignment of text in the cell. The returned value is one of CellVerticalAlignment constants.
getVerticalMerge()
public int getVerticalMerge()
Specifies how the cell is merged with other cells vertically.
Cells can only be merged vertically if their left and right boundaries are identical.
When cells are vertically merged, the display areas of the merged cells are consolidated. The consolidated area is used to display the contents of the first vertically merged cell and all other vertically merged cells must be empty.
Returns: int - The corresponding int value. The returned value is one of CellMerge constants.
getWidth()
public double getWidth()
Gets the width of the cell in points.
The width is calculated by Aspose.Words on document loading and saving. Currently, not every combination of table, cell and document properties is supported. The returned value may not be accurate for some documents. It may not exactly match the cell width as calculated by MS Word when the document is opened in MS Word.
Setting this property is not recommended. There is no guarantee that the cell will actually have the set width. The width may be adjusted to accommodate cell contents in an auto-fit table layout. Cells in other rows may have conflicting width settings. The table may be resized to fit into the container or to meet table width settings. Consider using getPreferredWidth() / setPreferredWidth(com.aspose.words.PreferredWidth) for setting the cell width. Setting this property sets getPreferredWidth() / setPreferredWidth(com.aspose.words.PreferredWidth) implicitly since version 15.8.
Returns: double - The width of the cell in points.
getWrapText()
public boolean getWrapText()
If true , wrap text for the cell.
Returns: boolean - The corresponding boolean value.
hashCode()
public native int hashCode()
Returns: int
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
setBorderAttr(int key, Object value)
public void setBorderAttr(int key, Object value)
Parameters:
Parameter | Type | Description |
---|---|---|
key | int | |
value | java.lang.Object |
setBottomPadding(double value)
public void setBottomPadding(double value)
Sets the amount of space (in points) to add below the contents of cell.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | The amount of space (in points) to add below the contents of cell. |
setFitText(boolean value)
public void setFitText(boolean value)
If true , fits text in the cell, compressing each paragraph to the width of the cell.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | The corresponding boolean value. |
setHorizontalMerge(int value)
public void setHorizontalMerge(int value)
Specifies how the cell is merged horizontally with other cells in the row.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int | The corresponding int value. The value must be one of CellMerge constants. |
setLeftPadding(double value)
public void setLeftPadding(double value)
Sets the amount of space (in points) to add to the left of the contents of cell.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | The amount of space (in points) to add to the left of the contents of cell. |
setOrientation(int value)
public void setOrientation(int value)
Sets the orientation of text in a table cell.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int | The orientation of text in a table cell. The value must be one of TextOrientation constants. |
setPaddings(double leftPadding, double topPadding, double rightPadding, double bottomPadding)
public void setPaddings(double leftPadding, double topPadding, double rightPadding, double bottomPadding)
Sets the amount of space (in points) to add to the left/top/right/bottom of the contents of cell.
Parameters:
Parameter | Type | Description |
---|---|---|
leftPadding | double | |
topPadding | double | |
rightPadding | double | |
bottomPadding | double |
setPreferredWidth(PreferredWidth value)
public void setPreferredWidth(PreferredWidth value)
Sets the preferred width of the cell.
The preferred width (along with the table’s Auto Fit option) determines how the actual width of the cell is calculated by the table layout algorithm. Table layout can be performed by Aspose.Words when it saves the document or by Microsoft Word when it displays the document.
The preferred width can be specified in points or in percent. The preferred width can also be specified as “auto”, which means no preferred width is specified.
The default value is PreferredWidth.AUTO.
Parameters:
Parameter | Type | Description |
---|---|---|
value | PreferredWidth | The preferred width of the cell. |
setRightPadding(double value)
public void setRightPadding(double value)
Sets the amount of space (in points) to add to the right of the contents of cell.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | The amount of space (in points) to add to the right of the contents of cell. |
setTopPadding(double value)
public void setTopPadding(double value)
Sets the amount of space (in points) to add above the contents of cell.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | The amount of space (in points) to add above the contents of cell. |
setVerticalAlignment(int value)
public void setVerticalAlignment(int value)
Sets the vertical alignment of text in the cell.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int | The vertical alignment of text in the cell. The value must be one of CellVerticalAlignment constants. |
setVerticalMerge(int value)
public void setVerticalMerge(int value)
Specifies how the cell is merged with other cells vertically.
Cells can only be merged vertically if their left and right boundaries are identical.
When cells are vertically merged, the display areas of the merged cells are consolidated. The consolidated area is used to display the contents of the first vertically merged cell and all other vertically merged cells must be empty.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int | The corresponding int value. The value must be one of CellMerge constants. |
setWidth(double value)
public void setWidth(double value)
Gets the width of the cell in points.
The width is calculated by Aspose.Words on document loading and saving. Currently, not every combination of table, cell and document properties is supported. The returned value may not be accurate for some documents. It may not exactly match the cell width as calculated by MS Word when the document is opened in MS Word.
Setting this property is not recommended. There is no guarantee that the cell will actually have the set width. The width may be adjusted to accommodate cell contents in an auto-fit table layout. Cells in other rows may have conflicting width settings. The table may be resized to fit into the container or to meet table width settings. Consider using getPreferredWidth() / setPreferredWidth(com.aspose.words.PreferredWidth) for setting the cell width. Setting this property sets getPreferredWidth() / setPreferredWidth(com.aspose.words.PreferredWidth) implicitly since version 15.8.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | The width of the cell in points. |
setWrapText(boolean value)
public void setWrapText(boolean value)
If true , wrap text for the cell.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | The corresponding boolean value. |
toString()
public String toString()
Returns: java.lang.String
wait()
public final void wait()
wait(long arg0)
public final native void wait(long arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long | |
arg1 | int |