public interface LineDocumentBase
extends javax.swing.text.Document
This is the base for both standalone and eclipse plugin implementations.
Modifier and Type | Method and Description |
---|---|
void |
addLastNotifiedDocumentListener(javax.swing.event.DocumentListener lastNotified)
Add this doc listener as the last one notified.
|
int |
getColumnOfOffset(int offset)
Converts an offset position (a position between the characters of the
text) to the column number in the line that contains the offset.
|
java.lang.String |
getDefaultLineDelimiter()
Get the default line delimiter.
|
int |
getLineCount()
Gets the total number of lines in the text document.
|
int |
getLineOfOffset(int offset)
Converts an offset position (a position between the characters of the
text) to the line number that contains the offset.
|
java.lang.CharSequence |
getLineText(int lineNumber)
Gets the text of the specified line, not including any newline character
at the end.
|
int |
getOffsetOfLineEnd(int lineNumber)
Gets the offset of the end of the specified line (return >=0).
|
int |
getOffsetOfLineStart(int lineNumber)
Gets the offset of the start of the specified line (return >=0).
|
boolean |
merge(java.lang.String newContent)
This is intended for the use in operations that change the content of the document on
a large scale, for example setting an entire new text.
|
void |
removeLastNotifiedDocumentListener(javax.swing.event.DocumentListener lastNotified)
Remove this doc listener.
|
addDocumentListener, addUndoableEditListener, createPosition, getDefaultRootElement, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, insertString, putProperty, remove, removeDocumentListener, removeUndoableEditListener, render
java.lang.String getDefaultLineDelimiter()
int getLineOfOffset(int offset) throws javax.swing.text.BadLocationException
offset
- Offset in document.javax.swing.text.BadLocationException
- When the offset is not valid.int getColumnOfOffset(int offset) throws javax.swing.text.BadLocationException
offset
- The offset that is to be checked.javax.swing.text.BadLocationException
- Bad Location Exception.int getOffsetOfLineStart(int lineNumber) throws javax.swing.text.BadLocationException
lineNumber
- The number of the line. Indexed in 1.javax.swing.text.BadLocationException
- When line does not exist.java.lang.IllegalArgumentException
- If the line number is out of range.int getOffsetOfLineEnd(int lineNumber) throws javax.swing.text.BadLocationException
lineNumber
- The number of the line. Indexed in 1.javax.swing.text.BadLocationException
- If the line number is out of range.int getLineCount()
boolean merge(java.lang.String newContent) throws javax.swing.text.BadLocationException
newContent
- The new content for the document. Null is not allowed.javax.swing.text.BadLocationException
- Should never happen but the underlying methods throws it.java.lang.CharSequence getLineText(int lineNumber) throws javax.swing.text.BadLocationException
lineNumber
- The number of the line. 1 based.javax.swing.text.BadLocationException
- When line number is invalid.void addLastNotifiedDocumentListener(javax.swing.event.DocumentListener lastNotified)
lastNotified
- Listener getting notified last of any changes.void removeLastNotifiedDocumentListener(javax.swing.event.DocumentListener lastNotified)
lastNotified
- Listener getting notified last of any changes.© Copyright Syncro Soft SRL 2002 - 2014.