aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/java/org/apache/poi/xwpf
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2015-02-05 23:31:59 +0000
committerNick Burch <nick@apache.org>2015-02-05 23:31:59 +0000
commitc42c709c9a9104b7cf4e87d2bb08c93b6bfb6703 (patch)
tree6d0f0ce8f03eac50ff12c05a447ad53112def75b /src/ooxml/java/org/apache/poi/xwpf
parenteeb40d677f1f17c2eef3821a4d63dad46ef7431f (diff)
downloadpoi-c42c709c9a9104b7cf4e87d2bb08c93b6bfb6703.tar.gz
poi-c42c709c9a9104b7cf4e87d2bb08c93b6bfb6703.zip
XWPF implementation of some common Paragraph methods
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1657717 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java/org/apache/poi/xwpf')
-rw-r--r--src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java45
1 files changed, 42 insertions, 3 deletions
diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java
index e80fcda29f..7ed629c10a 100644
--- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java
+++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java
@@ -380,6 +380,17 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para
}
/**
+ * @return The raw alignment value, {@link #getAlignment()} is suggested
+ */
+ public int getFontAlignment() {
+ return getAlignment().getValue();
+ }
+ public void setFontAlignment(int align) {
+ ParagraphAlignment pAlign = ParagraphAlignment.valueOf(align);
+ setAlignment(pAlign);
+ }
+
+ /**
* Returns the text vertical alignment which shall be applied to text in
* this paragraph.
* <p/>
@@ -942,7 +953,7 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para
return (indentation != null && indentation.isSetLeft()) ? indentation.getLeft().intValue()
: -1;
}
-
+
/**
* Specifies the indentation which shall be placed between the right text
* margin for this paragraph and the right edge of that paragraph's content
@@ -1061,6 +1072,27 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para
: -1;
}
+ public int getIndentFromLeft() {
+ return getIndentFromLeft();
+ }
+ public void setIndentFromLeft(int dxaLeft) {
+ setIndentationLeft(dxaLeft);
+ }
+
+ public int getIndentFromRight() {
+ return getIndentFromRight();
+ }
+ public void setIndentFromRight(int dxaRight) {
+ setIndentationRight(dxaRight);
+ }
+
+ public int getFirstLineIndent() {
+ return getIndentationFirstLine();
+ }
+ public void setFirstLineIndent(int first) {
+ setIndentationFirstLine(first);
+ }
+
/**
* This element specifies whether a consumer shall break Latin text which
* exceeds the text extents of a line by breaking the word across two lines
@@ -1069,7 +1101,7 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para
*
* @param wrap - boolean
*/
- public void setWordWrap(boolean wrap) {
+ public void setWordWrapped(boolean wrap) {
CTOnOff wordWrap = getCTPPr().isSetWordWrap() ? getCTPPr()
.getWordWrap() : getCTPPr().addNewWordWrap();
if (wrap)
@@ -1077,6 +1109,10 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para
else
wordWrap.unsetVal();
}
+ @Deprecated
+ public void setWordWrap(boolean wrap) {
+ setWordWrapped(wrap);
+ }
/**
* This element specifies whether a consumer shall break Latin text which
@@ -1086,7 +1122,7 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para
*
* @return boolean
*/
- public boolean isWordWrap() {
+ public boolean isWordWrapped() {
CTOnOff wordWrap = getCTPPr().isSetWordWrap() ? getCTPPr()
.getWordWrap() : null;
if (wordWrap != null) {
@@ -1096,6 +1132,9 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para
}
return false;
}
+ public boolean isWordWrap() {
+ return isWordWrapped();
+ }
/**
* This method provides a style to the paragraph