Method Summary |
|
public void | addBufferListener(BufferListener listener, int priority) Adds a buffer change listener. |
public void | addBufferListener(BufferListener listener) Adds a buffer change listener. |
public void | beginCompoundEdit() Starts a compound edit. |
public Position | createPosition(int offset) Creates a floating position. |
public void | endCompoundEdit() Ends a compound edit. |
protected void | fireBufferLoaded() |
protected void | fireContentInserted(int startLine, int offset, int numLines, int length) |
protected void | fireContentRemoved(int startLine, int offset, int numLines, int length) |
protected void | fireFoldHandlerChanged() |
protected void | fireFoldLevelChanged(int start, int end) |
protected void | firePreContentInserted(int startLine, int offset, int numLines, int length) |
protected void | firePreContentRemoved(int startLine, int offset, int numLines, int length) |
protected void | fireTransactionComplete() |
public boolean | getBooleanProperty(String name) Returns the value of a boolean property. |
public BufferListener[] | getBufferListeners() Returns an array of registered buffer change listeners. |
public String | getContextSensitiveProperty(int offset, String name) Some settings, like comment start and end strings, can
vary between different parts of a buffer (HTML text and inline
JavaScript, for example). |
public int | getCurrentIndentForLine(int lineIndex, int[] whitespaceChars) Returns the line's current leading indent. |
public Object | getDefaultProperty(String key) |
public int[] | getFoldAtLine(int line) Returns an array. |
public FoldHandler | getFoldHandler() Returns the current buffer's fold handler. |
public int | getFoldLevel(int line) Returns the fold level of the specified line. |
public int | getIdealIndentForLine(int lineIndex) Returns the ideal leading indent for the specified line. |
public int | getIndentSize() Returns the indent size used in this buffer. |
public int | getIntegerProperty(String name, int defaultValue) Returns the value of an integer property. |
public KeywordMap | getKeywordMapAtOffset(int offset) Returns the syntax highlighting keyword map in effect at the
specified offset. |
public int | getLength() Returns the number of characters in the buffer. |
public int | getLineCount() Returns the number of physical lines in the buffer. |
public int | getLineEndOffset(int line) Returns the end offset of the specified line. |
public int | getLineLength(int line) Returns the length of the specified line. |
public int | getLineOfOffset(int offset) Returns the line containing the specified offset. |
public int | getLineStartOffset(int line) Returns the start offset of the specified line. |
public String | getLineText(int line) Returns the text on the specified line. |
public void | getLineText(int line, Segment segment) Returns the specified line in a Segment .
Using a Segment is generally more
efficient than using a String because it
results in less memory allocation and array copying.
This method is thread-safe. |
public Mode | getMode() Returns this buffer's edit mode. |
public int | getOffsetOfVirtualColumn(int line, int column, int[] totalVirtualWidth) Returns the offset of a virtual column number (taking tabs
into account) relative to the start of the line in question.
Parameters: line - The line number Parameters: column - The virtual column number Parameters: totalVirtualWidth - If this array is non-null, the totalvirtual width will be stored in its first location if this methodreturns -1. |
public Pattern | getPatternProperty(String name, int flags) Returns the value of a property as a regular expression. |
public int | getPriorNonEmptyLine(int lineIndex) Auto indent needs this. |
public Object | getProperty(Object name) Returns the value of a buffer-local property.
Using this method is generally discouraged, because it returns an
Object which must be cast to another type
in order to be useful, and this can cause problems if the object
is of a different type than what the caller expects.
The following methods should be used instead:
This method is thread-safe.
Parameters: name - The property name. |
public ParserRuleSet | getRuleSetAtOffset(int offset) Returns the syntax highlighting ruleset at the specified offset. |
public String | getStringProperty(String name) Returns the value of a string property. |
public int | getTabSize() Returns the tab size used in this buffer. |
public String | getText(int start, int length) Returns the specified text range. |
public void | getText(int start, int length, Segment seg) Returns the specified text range in a Segment .
Using a Segment is generally more
efficient than using a String because it
results in less memory allocation and array copying.
This method is thread-safe. |
public TokenMarker | getTokenMarker() |
public int | getVirtualWidth(int line, int column) Returns the virtual column number (taking tabs into account) of the
specified position. |
public boolean | indentLine(int lineIndex, boolean canIncreaseIndent, boolean canDecreaseIndent) |
public boolean | indentLine(int lineIndex, boolean canDecreaseIndent) Indents the specified line.
Parameters: lineIndex - The line number to indent Parameters: canDecreaseIndent - If true, the indent can be decreased as aresult of this. |
public void | indentLines(int start, int end) Indents all specified lines. |
public void | indentLines(int[] lines) Indents all specified lines. |
public void | insert(int offset, String str) Inserts a string into the buffer. |
public void | insert(int offset, Segment seg) Inserts a string into the buffer. |
public void | insertAtColumn(int line, int col, String str) Like the
JEditBuffer.insert(int,String) method, but inserts the string at
the specified virtual column. |
public int | insertIndented(int offset, String text) Inserts a string into the buffer, indenting each line of the string
to match the indent of the first line.
Parameters: offset - The offset Parameters: text - The text The number of characters of indent inserted on each newline. |
public boolean | insideCompoundEdit() Returns if a compound edit is currently active. |
public void | invalidateCachedFoldLevels() Invalidates all cached fold level information. |
protected void | invalidateFoldLevels() |
public boolean | isDirty() Returns whether there have been unsaved changes to this buffer. |
public boolean | isEditable() Returns true if this file is editable, false otherwise. |
public boolean | isElectricKey(char ch) |
public boolean | isElectricKey(char ch, int line) |
protected boolean | isFileReadOnly() |
public boolean | isFoldEnd(int line) Returns if the specified line ends a fold. |
public boolean | isFoldStart(int line) Returns if the specified line begins a fold. |
public boolean | isLoading() |
public boolean | isPerformingIO() Returns true if the buffer is currently performing I/O. |
public boolean | isReadOnly() Returns true if this file is read only, false otherwise. |
public boolean | isTransactionInProgress() Returns if an undo or compound edit is currently in progress. |
public boolean | isUndoInProgress() Returns if an undo or redo is currently being performed. |
protected void | loadText(Segment seg, IntegerArray endOffsets) |
public void | markTokens(int lineIndex, TokenHandler tokenHandler) Returns the syntax tokens for the specified line. |
protected void | parseBufferLocalProperties() |
public void | propertiesChanged() Reloads settings from the properties. |
public void | readLock() The buffer is guaranteed not to change between calls to
JEditBuffer.readLock() and
JEditBuffer.readUnlock() . |
public void | readUnlock() The buffer is guaranteed not to change between calls to
JEditBuffer.readLock() and
JEditBuffer.readUnlock() . |
public void | redo(TextArea textArea) Redoes the most recently undone edit. |
public void | remove(int offset, int length) Removes the specified rang efrom the buffer. |
public void | removeBufferListener(BufferListener listener) Removes a buffer change listener. |
public void | removeTrailingWhiteSpace(int[] lines) Removes trailing whitespace from all lines in the specified list. |
public void | resetCachedProperties() |
public void | setBooleanProperty(String name, boolean value) Sets a boolean property. |
public void | setDefaultProperty(String name, Object value) |
public void | setDirty(boolean d) Sets the 'dirty' (changed since last save) flag of this buffer. |
protected void | setFileReadOnly(boolean readOnly) |
public void | setFoldHandler(FoldHandler foldHandler) Sets the buffer's fold handler. |
public void | setIntegerProperty(String name, int value) Sets an integer property. |
public void | setLoading(boolean loading) |
public void | setMode(String mode) Sets this buffer's edit mode. |
public void | setMode(Mode mode) Sets this buffer's edit mode. |
public void | setPerformingIO(boolean io) Returns true if the buffer is currently performing I/O. |
public void | setProperty(String name, Object value) Sets the value of a buffer-local property. |
public void | setReadOnly(boolean readOnly) Sets the read only flag. |
public void | setStringProperty(String name, String value) Sets a string property. |
public void | setTokenMarker(TokenMarker tokenMarker) |
public void | shiftIndentLeft(int[] lines) Shifts the indent of each line in the specified list to the left. |
public void | shiftIndentRight(int[] lines) Shifts the indent of each line in the specified list to the right. |
public void | undo(TextArea textArea) Undoes the most recent edit. |
public void | unsetProperty(String name) Clears the value of a buffer-local property. |
public void | writeLock() Attempting to obtain read lock will block between calls to
JEditBuffer.writeLock() and
JEditBuffer.writeUnlock() . |
public void | writeUnlock() Attempting to obtain read lock will block between calls to
JEditBuffer.writeLock() and
JEditBuffer.writeUnlock() . |