Package nz.ac.waikato.cms.gui.core
Interface TextPaneComponent
- All Known Implementing Classes:
BaseTextPane,BaseTextPaneWithWordWrap
public interface TextPaneComponent
Interface for widgets that behave like a text pane.
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
Method Summary
Modifier and TypeMethodDescriptionintReturns the current position of the cursor.Returns the underlying document.Returns the selected text.getText()Returns the text to display.booleanReturns whether the text pane is editable or not.voidsetCaretPosition(int value) Sets the position of the cursor.voidSets the position of the cursor at the end.voidsetEditable(boolean value) Sets whether the text pane is editable or not.voidSets the text to display.
-
Method Details
-
setText
Sets the text to display.- Parameters:
value- the text
-
getText
String getText()Returns the text to display.- Returns:
- the text
-
getSelectedText
String getSelectedText()Returns the selected text.- Returns:
- the selected text
-
setEditable
void setEditable(boolean value) Sets whether the text pane is editable or not.- Parameters:
value- if true the text pane is editable
-
isEditable
boolean isEditable()Returns whether the text pane is editable or not.- Returns:
- true if the text pane is editable
-
getDocument
Document getDocument()Returns the underlying document.- Returns:
- the document
-
setCaretPosition
void setCaretPosition(int value) Sets the position of the cursor.- Parameters:
value- the position
-
getCaretPosition
int getCaretPosition()Returns the current position of the cursor.- Returns:
- the cursor position
-
setCaretPositionLast
void setCaretPositionLast()Sets the position of the cursor at the end.
-