|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pivot.wtk.Component
org.apache.pivot.wtk.Container
org.apache.pivot.wtk.TextPane
@DefaultProperty(value="document") public class TextPane
Component that allows a user to enter and edit multiple lines of (optionally formatted) text.
Nested Class Summary | |
---|---|
static class |
TextPane.ScrollDirection
Enum representing a scroll direction. |
static interface |
TextPane.Skin
Text pane skin interface. |
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Container |
---|
Container.EDT_Checker |
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Component |
---|
Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary |
Nested classes/interfaces inherited from interface org.apache.pivot.collections.Sequence |
---|
Sequence.Tree<T> |
Constructor Summary | |
---|---|
TextPane()
|
Method Summary | |
---|---|
void |
clearSelection()
Clears the selection. |
void |
copy()
|
void |
cut()
|
void |
delete(boolean backspace)
|
Bounds |
getCharacterBounds(int offset)
|
int |
getCharacterCount()
Returns character count of the document. |
Document |
getDocument()
Returns the document that backs the text pane. |
int |
getInsertionPoint(int x,
int y)
|
int |
getNextInsertionPoint(int x,
int from,
TextPane.ScrollDirection direction)
|
int |
getRowAt(int offset)
|
int |
getRowCount()
|
String |
getSelectedText()
Returns the currently selected text. |
Span |
getSelection()
Returns a span representing the current selection. |
int |
getSelectionLength()
Returns the length of the selection. |
int |
getSelectionStart()
Returns the starting index of the selection. |
String |
getText()
Convenience method to get all the text from the current document into a single string. |
String |
getText(int beginIndex,
int endIndex)
Convenience method to get a portion of the document text into a single string. |
ListenerList<TextPaneCharacterListener> |
getTextPaneCharacterListeners()
|
ListenerList<TextPaneListener> |
getTextPaneListeners()
|
ListenerList<TextPaneSelectionListener> |
getTextPaneSelectionListeners()
|
void |
insert(char character)
|
void |
insert(String text)
|
void |
insertImage(Image image)
|
void |
insertParagraph()
|
boolean |
isEditable()
Returns the text pane's editable flag. |
void |
paste()
|
void |
redo()
|
void |
selectAll()
Selects all text. |
void |
setDocument(Document document)
Sets the document that backs the text pane. |
void |
setEditable(boolean editable)
Sets the text pane's editable flag. |
void |
setSelection(int selectionStart,
int selectionLength)
Sets the selection. |
void |
setSelection(Span selection)
Sets the selection. |
protected void |
setSkin(Skin skin)
Sets the skin, replacing any previous skin. |
void |
setText(String text)
Convenience method to create a text-only document consisting of one paragraph per line of the given text. |
void |
undo()
|
Methods inherited from class org.apache.pivot.wtk.Container |
---|
add, assertEventDispatchThread, assertEventDispatchThread, clear, containsFocus, descendantAdded, descendantGainedFocus, descendantLostFocus, descendantRemoved, get, getComponentAt, getContainerListeners, getContainerMouseListeners, getDescendantAt, getFocusTraversalPolicy, getGraphics, getLength, getNamedComponent, indexOf, insert, invalidate, isAncestor, isDoubleBuffered, iterator, layout, load, mouseClick, mouseDown, mouseMove, mouseOut, mouseUp, mouseWheel, move, paint, remove, remove, removeAll, repaint, requestFocus, setDoubleBuffered, setEventDispatchThreadChecker, setFocusTraversalPolicy, setParent, setVisible, store, transferFocus, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TextPane()
Method Detail |
---|
protected void setSkin(Skin skin)
Component
setSkin
in class Component
skin
- The new skin.public Document getDocument()
public void setDocument(Document document)
document
- public void insert(char character)
public void insert(String text)
public void insertImage(Image image)
public void insertParagraph()
public int getCharacterCount()
public void delete(boolean backspace)
public void cut()
public void copy()
public void paste()
public void undo()
public void redo()
public String getText()
setText(java.lang.String)
public String getText(int beginIndex, int endIndex)
beginIndex
- The 0-based offset where to start retrieving text.endIndex
- The ending offset + 1 of the text to retrieve.
null
if there is no document.public void setText(String text)
public int getSelectionStart()
public int getSelectionLength()
public Span getSelection()
public void setSelection(int selectionStart, int selectionLength)
selectionStart
- The starting index of the selection.selectionLength
- The length of the selection.public final void setSelection(Span selection)
selection
- setSelection(int, int)
public void selectAll()
public void clearSelection()
public String getSelectedText()
public boolean isEditable()
public void setEditable(boolean editable)
editable
- public int getInsertionPoint(int x, int y)
public int getNextInsertionPoint(int x, int from, TextPane.ScrollDirection direction)
public int getRowAt(int offset)
public int getRowCount()
public Bounds getCharacterBounds(int offset)
public ListenerList<TextPaneListener> getTextPaneListeners()
public ListenerList<TextPaneCharacterListener> getTextPaneCharacterListeners()
public ListenerList<TextPaneSelectionListener> getTextPaneSelectionListeners()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |