public class ParagraphFormat
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
void |
clearFormatting()
Resets to default paragraph formatting.
|
java.lang.Object |
fetchInheritedBorderAttr(int key) |
java.lang.Object |
fetchInheritedShadingAttr(int key) |
boolean |
getAddSpaceBetweenFarEastAndAlpha()
Gets a flag indicating whether inter-character spacing is automatically adjusted between regions of Latin text and regions of East Asian text in the current paragraph.
|
boolean |
getAddSpaceBetweenFarEastAndDigit()
Gets a flag indicating whether inter-character spacing is automatically adjusted between regions of numbers and regions of East Asian text in the current paragraph.
|
int |
getAlignment()
Gets text alignment for the paragraph.
|
boolean |
getBidi()
Gets whether this is a right-to-left paragraph.
|
BorderCollection |
getBorders()
Gets collection of borders of the paragraph.
|
double |
getCharacterUnitFirstLineIndent()
Gets the value (in characters) for the first-line or hanging indent.
|
double |
getCharacterUnitLeftIndent()
Gets the left indent value (in characters) for the specified paragraphs.
|
double |
getCharacterUnitRightIndent()
Gets the right indent value (in characters) for the specified paragraphs.
|
java.lang.Object |
getDirectBorderAttr(int key) |
int |
getDropCapPosition()
Gets the position for a drop cap text.
|
boolean |
getFarEastLineBreakControl()
Gets a flag indicating whether East Asian line-breaking rules are applied to the current paragraph.
|
double |
getFirstLineIndent()
Gets the value (in points) for a first line or hanging indent.
|
boolean |
getHangingPunctuation()
Gets a flag indicating whether hanging punctuation is enabled for the current paragraph.
|
boolean |
getKeepTogether()
True if all lines in the paragraph are to remain on the same page.
|
boolean |
getKeepWithNext()
True if the paragraph is to remains on the same page as the paragraph that follows it.
|
double |
getLeftIndent()
Gets the value (in points) that represents the left indent for paragraph.
|
double |
getLineSpacing()
Gets the line spacing (in points) for the paragraph.
|
int |
getLineSpacingRule()
Gets the line spacing for the paragraph.
|
int |
getLinesToDrop()
Gets the number of lines of the paragraph text used to calculate the drop cap height.
|
double |
getLineUnitAfter()
Gets the amount of spacing (in gridlines) after the paragraphs.
|
double |
getLineUnitBefore()
Gets the amount of spacing (in gridlines) before the paragraphs.
|
boolean |
getNoSpaceBetweenParagraphsOfSameStyle()
When true,
getSpaceBefore() / setSpaceBefore(double) and getSpaceAfter() / setSpaceAfter(double) will be ignored between the paragraphs of the same style. |
int |
getOutlineLevel()
Specifies the outline level of the paragraph in the document.
|
boolean |
getPageBreakBefore()
True if a page break is forced before the paragraph.
|
double |
getRightIndent()
Gets the value (in points) that represents the right indent for paragraph.
|
Shading |
getShading()
Returns a Shading object that refers to the shading formatting for the paragraph.
|
boolean |
getSnapToGrid()
Specifies whether the current paragraph should use the document grid lines per page settings when laying out the contents in the paragraph.
|
double |
getSpaceAfter()
Gets the amount of spacing (in points) after the paragraph.
|
boolean |
getSpaceAfterAuto()
True if the amount of spacing after the paragraph is set automatically.
|
double |
getSpaceBefore()
Gets the amount of spacing (in points) before the paragraph.
|
boolean |
getSpaceBeforeAuto()
True if the amount of spacing before the paragraph is set automatically.
|
Style |
getStyle()
Gets the paragraph style applied to this formatting.
|
int |
getStyleIdentifier()
Gets the locale independent style identifier of the paragraph style applied to this formatting.
|
java.lang.String |
getStyleName()
Gets the name of the paragraph style applied to this formatting.
|
boolean |
getSuppressAutoHyphens()
Specifies whether the current paragraph should be exempted from any hyphenation which is applied in the document settings.
|
boolean |
getSuppressLineNumbers()
Specifies whether the current paragraph's lines should be exempted from line numbering which is applied in the parent section.
|
TabStopCollection |
getTabStops()
Gets the collection of custom tab stops defined for this object.
|
boolean |
getWidowControl()
True if the first and last lines in the paragraph are to remain on the same page as the rest of the paragraph.
|
boolean |
getWordWrap()
If this property is false, Latin text in the middle of a word can be wrapped for the current paragraph.
|
boolean |
isHeading()
True when the paragraph style is one of the built-in Heading styles.
|
boolean |
isListItem()
True when the paragraph is an item in a bulleted or numbered list.
|
void |
setAddSpaceBetweenFarEastAndAlpha(boolean value)
Sets a flag indicating whether inter-character spacing is automatically adjusted between regions of Latin text and regions of East Asian text in the current paragraph.
|
void |
setAddSpaceBetweenFarEastAndDigit(boolean value)
Sets a flag indicating whether inter-character spacing is automatically adjusted between regions of numbers and regions of East Asian text in the current paragraph.
|
void |
setAlignment(int value)
Sets text alignment for the paragraph.
|
void |
setBidi(boolean value)
Sets whether this is a right-to-left paragraph.
|
void |
setBorderAttr(int key,
java.lang.Object value) |
void |
setCharacterUnitFirstLineIndent(double value)
Sets the value (in characters) for the first-line or hanging indent.
|
void |
setCharacterUnitLeftIndent(double value)
Sets the left indent value (in characters) for the specified paragraphs.
|
void |
setCharacterUnitRightIndent(double value)
Sets the right indent value (in characters) for the specified paragraphs.
|
void |
setDropCapPosition(int value)
Sets the position for a drop cap text.
|
void |
setFarEastLineBreakControl(boolean value)
Sets a flag indicating whether East Asian line-breaking rules are applied to the current paragraph.
|
void |
setFirstLineIndent(double value)
Sets the value (in points) for a first line or hanging indent.
|
void |
setHangingPunctuation(boolean value)
Sets a flag indicating whether hanging punctuation is enabled for the current paragraph.
|
void |
setKeepTogether(boolean value)
True if all lines in the paragraph are to remain on the same page.
|
void |
setKeepWithNext(boolean value)
True if the paragraph is to remains on the same page as the paragraph that follows it.
|
void |
setLeftIndent(double value)
Sets the value (in points) that represents the left indent for paragraph.
|
void |
setLineSpacing(double value)
Sets the line spacing (in points) for the paragraph.
|
void |
setLineSpacingRule(int value)
Sets the line spacing for the paragraph.
|
void |
setLinesToDrop(int value)
Sets the number of lines of the paragraph text used to calculate the drop cap height.
|
void |
setLineUnitAfter(double value)
Sets the amount of spacing (in gridlines) after the paragraphs.
|
void |
setLineUnitBefore(double value)
Sets the amount of spacing (in gridlines) before the paragraphs.
|
void |
setNoSpaceBetweenParagraphsOfSameStyle(boolean value)
When true,
getSpaceBefore() / setSpaceBefore(double) and getSpaceAfter() / setSpaceAfter(double) will be ignored between the paragraphs of the same style. |
void |
setOutlineLevel(int value)
Specifies the outline level of the paragraph in the document.
|
void |
setPageBreakBefore(boolean value)
True if a page break is forced before the paragraph.
|
void |
setRightIndent(double value)
Sets the value (in points) that represents the right indent for paragraph.
|
void |
setSnapToGrid(boolean value)
Specifies whether the current paragraph should use the document grid lines per page settings when laying out the contents in the paragraph.
|
void |
setSpaceAfter(double value)
Sets the amount of spacing (in points) after the paragraph.
|
void |
setSpaceAfterAuto(boolean value)
True if the amount of spacing after the paragraph is set automatically.
|
void |
setSpaceBefore(double value)
Sets the amount of spacing (in points) before the paragraph.
|
void |
setSpaceBeforeAuto(boolean value)
True if the amount of spacing before the paragraph is set automatically.
|
void |
setStyle(Style value)
Sets the paragraph style applied to this formatting.
|
void |
setStyleIdentifier(int value)
Sets the locale independent style identifier of the paragraph style applied to this formatting.
|
void |
setStyleName(java.lang.String value)
Sets the name of the paragraph style applied to this formatting.
|
void |
setSuppressAutoHyphens(boolean value)
Specifies whether the current paragraph should be exempted from any hyphenation which is applied in the document settings.
|
void |
setSuppressLineNumbers(boolean value)
Specifies whether the current paragraph's lines should be exempted from line numbering which is applied in the parent section.
|
void |
setWidowControl(boolean value)
True if the first and last lines in the paragraph are to remain on the same page as the rest of the paragraph.
|
void |
setWordWrap(boolean value)
If this property is false, Latin text in the middle of a word can be wrapped for the current paragraph.
|
public void clearFormatting()
public int getAlignment()
ParagraphAlignment constants.public void setAlignment(int value)
value - Text alignment for the paragraph. The value must be one of ParagraphAlignment constants.public boolean getNoSpaceBetweenParagraphsOfSameStyle()
getSpaceBefore() / setSpaceBefore(double) and getSpaceAfter() / setSpaceAfter(double) will be ignored between the paragraphs of the same style.
This setting only takes affect when applied to a paragraph style. If applied to a paragraph directly, it has no effect.
boolean value.public void setNoSpaceBetweenParagraphsOfSameStyle(boolean value)
getSpaceBefore() / setSpaceBefore(double) and getSpaceAfter() / setSpaceAfter(double) will be ignored between the paragraphs of the same style.
This setting only takes affect when applied to a paragraph style. If applied to a paragraph directly, it has no effect.
value - The corresponding boolean value.public boolean getKeepTogether()
boolean value.public void setKeepTogether(boolean value)
value - The corresponding boolean value.public boolean getKeepWithNext()
boolean value.public void setKeepWithNext(boolean value)
value - The corresponding boolean value.public boolean getPageBreakBefore()
boolean value.public void setPageBreakBefore(boolean value)
value - The corresponding boolean value.public boolean getSuppressLineNumbers()
boolean value.public void setSuppressLineNumbers(boolean value)
value - The corresponding boolean value.public boolean getSuppressAutoHyphens()
boolean value.public void setSuppressAutoHyphens(boolean value)
value - The corresponding boolean value.public boolean getWidowControl()
boolean value.public void setWidowControl(boolean value)
value - The corresponding boolean value.public boolean getAddSpaceBetweenFarEastAndAlpha()
public void setAddSpaceBetweenFarEastAndAlpha(boolean value)
value - A flag indicating whether inter-character spacing is automatically adjusted between regions of Latin text and regions of East Asian text in the current paragraph.public boolean getAddSpaceBetweenFarEastAndDigit()
public void setAddSpaceBetweenFarEastAndDigit(boolean value)
value - A flag indicating whether inter-character spacing is automatically adjusted between regions of numbers and regions of East Asian text in the current paragraph.public boolean getFarEastLineBreakControl()
public void setFarEastLineBreakControl(boolean value)
value - A flag indicating whether East Asian line-breaking rules are applied to the current paragraph.public boolean getWordWrap()
boolean value.public void setWordWrap(boolean value)
value - The corresponding boolean value.public boolean getHangingPunctuation()
public void setHangingPunctuation(boolean value)
value - A flag indicating whether hanging punctuation is enabled for the current paragraph.public boolean getBidi()
When true, the runs and other inline objects in this paragraph are laid out right to left.
public void setBidi(boolean value)
When true, the runs and other inline objects in this paragraph are laid out right to left.
value - Whether this is a right-to-left paragraph.public double getLeftIndent()
public void setLeftIndent(double value)
value - The value (in points) that represents the left indent for paragraph.public double getCharacterUnitLeftIndent()
public void setCharacterUnitLeftIndent(double value)
value - The left indent value (in characters) for the specified paragraphs.public double getRightIndent()
public void setRightIndent(double value)
value - The value (in points) that represents the right indent for paragraph.public double getCharacterUnitRightIndent()
public void setCharacterUnitRightIndent(double value)
value - The right indent value (in characters) for the specified paragraphs.public double getFirstLineIndent()
Use positive values to set the first-line indent, and negative values to set the hanging indent.
public void setFirstLineIndent(double value)
Use positive values to set the first-line indent, and negative values to set the hanging indent.
value - The value (in points) for a first line or hanging indent.public double getCharacterUnitFirstLineIndent()
Use positive values to set the first-line indent, and negative values to set the hanging indent.
public void setCharacterUnitFirstLineIndent(double value)
Use positive values to set the first-line indent, and negative values to set the hanging indent.
value - The value (in characters) for the first-line or hanging indent.public boolean getSpaceBeforeAuto()
When set to true, overrides the effect of getSpaceBefore() / setSpaceBefore(double).
When you set paragraph Space Before and Space After to Auto, Microsoft Word adds 14 points spacing between paragraphs automatically according to the following rules:
boolean value.public void setSpaceBeforeAuto(boolean value)
When set to true, overrides the effect of getSpaceBefore() / setSpaceBefore(double).
When you set paragraph Space Before and Space After to Auto, Microsoft Word adds 14 points spacing between paragraphs automatically according to the following rules:
value - The corresponding boolean value.public boolean getSpaceAfterAuto()
When set to true, overrides the effect of getSpaceAfter() / setSpaceAfter(double).
When you set paragraph Space Before and Space After to Auto, Microsoft Word adds 14 points spacing between paragraphs automatically according to the following rules:
boolean value.public void setSpaceAfterAuto(boolean value)
When set to true, overrides the effect of getSpaceAfter() / setSpaceAfter(double).
When you set paragraph Space Before and Space After to Auto, Microsoft Word adds 14 points spacing between paragraphs automatically according to the following rules:
value - The corresponding boolean value.public double getSpaceBefore()
Has no effect when getSpaceBeforeAuto() / setSpaceBeforeAuto(boolean) is true.
Valid values range from 0 to 1584 inclusive.
java.lang.IllegalArgumentException - Throws when argument was out of the range of valid values.public void setSpaceBefore(double value)
Has no effect when getSpaceBeforeAuto() / setSpaceBeforeAuto(boolean) is true.
Valid values range from 0 to 1584 inclusive.
value - The amount of spacing (in points) before the paragraph.java.lang.IllegalArgumentException - Throws when argument was out of the range of valid values.public double getLineUnitBefore()
public void setLineUnitBefore(double value)
value - The amount of spacing (in gridlines) before the paragraphs.public double getSpaceAfter()
Has no effect when getSpaceAfterAuto() / setSpaceAfterAuto(boolean) is true.
Valid values range from 0 to 1584 inclusive.
java.lang.IllegalArgumentException - Throws when argument was out of the range of valid values.public void setSpaceAfter(double value)
Has no effect when getSpaceAfterAuto() / setSpaceAfterAuto(boolean) is true.
Valid values range from 0 to 1584 inclusive.
value - The amount of spacing (in points) after the paragraph.java.lang.IllegalArgumentException - Throws when argument was out of the range of valid values.public double getLineUnitAfter()
public void setLineUnitAfter(double value)
value - The amount of spacing (in gridlines) after the paragraphs.public int getLineSpacingRule()
LineSpacingRule constants.public void setLineSpacingRule(int value)
value - The line spacing for the paragraph. The value must be one of LineSpacingRule constants.public double getLineSpacing()
When LineSpacingRule property is set to AtLeast, the line spacing can be greater than or equal to, but never less than the specified LineSpacing value.
When LineSpacingRule property is set to Exactly, the line spacing never changes from the specified LineSpacing value, even if a larger font is used within the paragraph.
public void setLineSpacing(double value)
When LineSpacingRule property is set to AtLeast, the line spacing can be greater than or equal to, but never less than the specified LineSpacing value.
When LineSpacingRule property is set to Exactly, the line spacing never changes from the specified LineSpacing value, even if a larger font is used within the paragraph.
value - The line spacing (in points) for the paragraph.public boolean isHeading()
boolean value.public boolean isListItem()
boolean value.public int getOutlineLevel()
int value. The returned value is one of OutlineLevel constants.public void setOutlineLevel(int value)
value - The corresponding int value. The value must be one of OutlineLevel constants.public int getLinesToDrop()
public void setLinesToDrop(int value)
value - The number of lines of the paragraph text used to calculate the drop cap height.public int getDropCapPosition()
DropCapPosition constants.public void setDropCapPosition(int value)
value - The position for a drop cap text. The value must be one of DropCapPosition constants.public Shading getShading()
public BorderCollection getBorders()
public Style getStyle()
public void setStyle(Style value)
value - The paragraph style applied to this formatting.public java.lang.String getStyleName()
public void setStyleName(java.lang.String value)
value - The name of the paragraph style applied to this formatting.public int getStyleIdentifier()
StyleIdentifier constants.public void setStyleIdentifier(int value)
value - The locale independent style identifier of the paragraph style applied to this formatting. The value must be one of StyleIdentifier constants.public boolean getSnapToGrid()
boolean value.public void setSnapToGrid(boolean value)
value - The corresponding boolean value.public TabStopCollection getTabStops()
public java.lang.Object getDirectBorderAttr(int key)
public java.lang.Object fetchInheritedBorderAttr(int key)
public void setBorderAttr(int key,
java.lang.Object value)
public java.lang.Object fetchInheritedShadingAttr(int key)