public class Textbox extends Frame implements ListContainer, ParagraphContainer
mElement, mFrameContainer, mOwnerDocument, mStyleHandler
Modifier and Type | Method and Description |
---|---|
List |
addList()
Add a new List to this container.
|
List |
addList(ListDecorator decorator)
Add a List with specified ListDecorator to this container.
|
Paragraph |
addParagraph(String textContent)
Add paragraph at the end of the container with specified text content.
|
void |
clearContent()
Remove all the content of this text box.
|
void |
clearList()
Remove all Lists from this container.
|
static Textbox |
getInstanceof(DrawTextBoxElement element)
Get a text box instance by an instance of
DrawTextBoxElement . |
OdfElement |
getListContainerElement()
Get the ODF element which can have
|
Iterator<List> |
getListIterator()
Return an Iterator of the Lists in this ListContainer.
|
DrawTextBoxElement |
getOdfElement()
Get the instance of
DrawTextBoxElement which represents this frame. |
Paragraph |
getParagraphByIndex(int index,
boolean isEmptyParagraphSkipped)
Return a paragraph with a given index.
|
Paragraph |
getParagraphByReverseIndex(int reverseIndex,
boolean isEmptyParagraphSkipped)
Return a paragraph with a given index.
|
OdfElement |
getParagraphContainerElement()
Get the ODF element which can have
|
Iterator<Paragraph> |
getParagraphIterator()
Return an Iterator of the paragraph in this container.
|
String |
getTextContent()
Get the text content of this text box.
|
static Textbox |
newTextbox(TextboxContainer container)
Create an instance of frame
|
boolean |
removeList(List list)
Remove the existing List from this container.
|
boolean |
removeParagraph(Paragraph para)
Remove paragraph from the container
|
void |
setTextContent(String content)
Set the text content of this text box.
|
getDesciption, getDrawFrameElement, getHyperlink, getInstanceof, getName, getRectangle, getStyleHandler, getTitle, newFrame, setBackgroundColor, setDescription, setHyperlink, setImage, setName, setRectangle, setTitle
getComponentByElement, getOwnerDocument, registerComponent, unregisterComponent
public static Textbox getInstanceof(DrawTextBoxElement element)
DrawTextBoxElement
.element
- - the instance of DrawTextBoxElementpublic static Textbox newTextbox(TextboxContainer container)
The frame will be added at the end of this container.
container
- - the frame container that contains this frame.public void setTextContent(String content)
This method will clear the content at first, and then create a paragraph with the given content.
content
- - the text contentclearContent()
,
addParagraph(String textContent)
public void clearContent()
public String getTextContent()
TextExtractor.getText(OdfElement)
public DrawTextBoxElement getOdfElement()
DrawTextBoxElement
which represents this frame.getOdfElement
in class Frame
DrawTextBoxElement
public List addList()
ListContainer
addList
in interface ListContainer
public List addList(ListDecorator decorator)
ListContainer
addList
in interface ListContainer
decorator
- the specified ListDecoratorpublic void clearList()
ListContainer
clearList
in interface ListContainer
public OdfElement getListContainerElement()
ListContainer
getListContainerElement
in interface ListContainer
public Iterator<List> getListIterator()
ListContainer
getListIterator
in interface ListContainer
Iterator
public boolean removeList(List list)
ListContainer
removeList
in interface ListContainer
public Paragraph addParagraph(String textContent)
ParagraphContainer
addParagraph
in interface ParagraphContainer
textContent
- - the text contentpublic OdfElement getParagraphContainerElement()
ParagraphContainer
getParagraphContainerElement
in interface ParagraphContainer
public boolean removeParagraph(Paragraph para)
ParagraphContainer
removeParagraph
in interface ParagraphContainer
para
- - the instance of paragraphpublic Paragraph getParagraphByIndex(int index, boolean isEmptyParagraphSkipped)
ParagraphContainer
An index of zero represents the first paragraph.
If empty paragraph is skipped, the empty paragraph won't be counted.
getParagraphByIndex
in interface ParagraphContainer
index
- - the index started from 0.isEmptyParagraphSkipped
- - whether the empty paragraph is skipped or notpublic Paragraph getParagraphByReverseIndex(int reverseIndex, boolean isEmptyParagraphSkipped)
ParagraphContainer
An index of zero represents the last paragraph.
If empty paragraph is skipped, the empty paragraph won't be counted.
getParagraphByReverseIndex
in interface ParagraphContainer
reverseIndex
- - the index started from 0 in reverse order.isEmptyParagraphSkipped
- - whether the empty paragraph is skipped or notpublic Iterator<Paragraph> getParagraphIterator()
ParagraphContainer
getParagraphIterator
in interface ParagraphContainer
Copyright © 2010–2018 Apache Software Foundation; Copyright © 2018–2020 The Document Foundation. All rights reserved.