mTextboxContainerImpl = new TextboxContainerImpl();
return mTextboxContainerImpl;
}
static void appendTextElements(OdfElement ownerElement, String content, boolean isWhitespaceCollapsed) {
OdfFileDom ownerDocument = (OdfFileDom) ownerElement.getOwnerDocument();
if (isWhitespaceCollapsed) {
int i = 0, length = content.length();
String str = "";
while (i < length) {
char ch = content.charAt(i);
if (ch == ' ') {
int j = 1;
i++;
while ((i < length) && (content.charAt(i) == ' ')) {
j++;
i++;
}
if (j == 1) {
str += ' ';
} else {
str += ' ';
Text textnode = ownerDocument.createTextNode(str);
ownerElement.appendChild(textnode);
str = "";
TextSElement spaceElement = ownerDocument.newOdfElement(TextSElement.class);
ownerElement.appendChild(spaceElement);
spaceElement.setTextCAttribute(j - 1);
}
} else if (ch == '\n') {
if (str.length() > 0) {
Text textnode = ownerDocument.createTextNode(str);
ownerElement.appendChild(textnode);
str = "";
}
TextLineBreakElement lineBreakElement = ownerDocument.newOdfElement(TextLineBreakElement.class);
ownerElement.appendChild(lineBreakElement);
i++;
} else if (ch == '\t') {
if (str.length() > 0) {
Text textnode = ownerElement.getOwnerDocument().createTextNode(str);
ownerElement.appendChild(textnode);
str = "";
}
TextTabElement tabElement = ownerDocument.newOdfElement(TextTabElement.class);
ownerElement.appendChild(tabElement);
i++;
} else if (ch == '\r') {
i++;
} else {
str += ch;
i++;
}
}
if (str.length() > 0) {
Text textnode = ownerDocument.createTextNode(str);
ownerElement.appendChild(textnode);
}
} else {
Text textnode = ownerDocument.createTextNode(content);
ownerElement.appendChild(textnode);
}
}