|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DJDocument
Interface shared by the Definitions Document, Open Definitions Document, and Interactions Document. Characteristic of native DrJava Documents (as opposed to DrJava plugin documents).
| Field Summary |
|---|
| Fields inherited from interface javax.swing.text.Document |
|---|
StreamDescriptionProperty, TitleProperty |
| Method Summary | |
|---|---|
int |
_getIndentOfCurrStmt(int pos)
Returns the indent level of the start of the statement that the cursor is on. |
int |
_getIndentOfCurrStmt(int pos,
char[] delims)
Returns the indent level of the start of the statement that the cursor is on. |
int |
_getIndentOfCurrStmt(int pos,
char[] delims,
char[] whitespace)
Returns the indent level of the start of the statement that the cursor is on. |
int |
_getLineEndPos(int pos)
Returns the absolute position of the end of the current line. |
int |
_getLineFirstCharPos(int pos)
Returns the absolute position of the first non-whitespace character on the current line. |
int |
_getLineStartPos(int pos)
Returns the absolute position of the beginning of the current line. |
int |
balanceBackward()
Finds the match for the closing brace immediately to the left, assuming there is such a brace. |
int |
balanceForward()
Finds the match for the open brace immediately to the right, assuming there is such a brace. |
void |
clear()
Clears the entire text of the document. |
int |
findCharOnLine(int pos,
char findChar)
Determines if the given character exists on the line where the given cursor position is. |
int |
findNextEnclosingBrace(int pos,
char opening,
char closing)
Searching forwards, finds the position of the enclosing brace. |
int |
findPrevDelimiter(int pos,
char[] delims)
Searching backwards, finds the position of the first character that is one of the given delimiters. |
int |
findPrevDelimiter(int pos,
char[] delims,
boolean skipParenPhrases)
Searching backwards, finds the position of the first character that is one of the given delimiters. |
int |
findPrevEnclosingBrace(int pos,
char opening,
char closing)
Searching backwards, finds the position of the enclosing brace. |
int |
getCurrentLocation()
Gets the current location of the cursor the document. |
int |
getFirstNonWSCharPos(int pos)
Finds the position of the first non-whitespace character after pos. |
int |
getFirstNonWSCharPos(int pos,
boolean acceptComments)
Similar to the single-argument version, but allows including comments. |
int |
getFirstNonWSCharPos(int pos,
char[] whitespace,
boolean acceptComments)
Finds the position of the first non-whitespace character after pos. |
ArrayList<HighlightStatus> |
getHighlightStatus(int start,
int end)
Returns highlight status info for text between start and end, coalescing adjoining blocks with the same status. |
int |
getIndent()
Gets the indent level. |
int |
getIntelligentBeginLinePos(int currPos)
Returns the "intelligent" beginning of line. |
ReducedModelControl |
getReduced()
|
ReducedModelState |
getStateAtCurrent()
|
String |
getText()
Gets the entire text of the document. |
void |
indentLines(int selStart,
int selEnd)
Default indentation - uses OTHER flag and no progress indicator. |
void |
indentLines(int selStart,
int selEnd,
Indenter.IndentReason reason,
ProgressMonitor pm)
Parameterized indentation for special-case handling. |
void |
insertString(int offset,
String str,
AttributeSet a)
Inserts a string of text into the document. |
void |
move(int dist)
Moves the current location the specified number of chars (positive is right; negative is left). |
void |
remove(int offset,
int len)
Removes a block of text from the specified location. |
void |
setCurrentLocation(int loc)
Change the current location of the document |
void |
setIndent(int indent)
Sets the indent to a particular number of spaces. |
| Methods inherited from interface edu.rice.cs.util.text.AbstractDocumentInterface |
|---|
append, createPosition, getLength, getText |
| Methods inherited from interface javax.swing.text.StyledDocument |
|---|
addStyle, getBackground, getCharacterElement, getFont, getForeground, getLogicalStyle, getParagraphElement, getStyle, removeStyle, setCharacterAttributes, setLogicalStyle, setParagraphAttributes |
| Methods inherited from interface javax.swing.text.Document |
|---|
addDocumentListener, addUndoableEditListener, createPosition, getDefaultRootElement, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, putProperty, removeDocumentListener, removeUndoableEditListener, render |
| Method Detail |
|---|
int getIndent()
void setIndent(int indent)
indent - the size of indent that you want for the document
ArrayList<HighlightStatus> getHighlightStatus(int start,
int end)
int getCurrentLocation()
void setCurrentLocation(int loc)
loc - the new absolute locationvoid move(int dist)
dist - the distance from the current location to the new location.int balanceBackward()
int balanceForward()
ReducedModelState getStateAtCurrent()
int findPrevEnclosingBrace(int pos,
char opening,
char closing)
throws BadLocationException
pos - Position to start fromopening - opening brace characterclosing - closing brace character
BadLocationException
int findNextEnclosingBrace(int pos,
char opening,
char closing)
throws BadLocationException
pos - Position to start fromopening - opening brace characterclosing - closing brace character
BadLocationException
int findPrevDelimiter(int pos,
char[] delims)
throws BadLocationException
pos - Position to start fromdelims - array of characters to search for
BadLocationException
int findPrevDelimiter(int pos,
char[] delims,
boolean skipParenPhrases)
throws BadLocationException
pos - Position to start fromdelims - array of characters to search forskipParenPhrases - whether to look for delimiters inside paren phrases
(eg. semicolons in a for statement)
BadLocationException
void indentLines(int selStart,
int selEnd)
selStart - the offset of the initial character of the region to indentselEnd - the offset of the last character of the region to indent
void indentLines(int selStart,
int selEnd,
Indenter.IndentReason reason,
ProgressMonitor pm)
throws OperationCanceledException
selStart - the offset of the initial character of the region to indentselEnd - the offset of the last character of the region to indentreason - a flag from Indenter
to indicate the reason for the indent (indent logic may vary slightly based on the trigger action)pm - used to display progress, null if no reporting is desired
OperationCanceledException
int getIntelligentBeginLinePos(int currPos)
throws BadLocationException
currPos - A position on the current line
BadLocationException
int _getIndentOfCurrStmt(int pos)
throws BadLocationException
pos - Cursor position
BadLocationException
int _getIndentOfCurrStmt(int pos,
char[] delims)
throws BadLocationException
pos - Cursor position
BadLocationException
int _getIndentOfCurrStmt(int pos,
char[] delims,
char[] whitespace)
throws BadLocationException
pos - Cursor positiondelims - Delimiter characters denoting end of statementwhitespace - characters to skip when looking for beginning of next statement
BadLocationException
int findCharOnLine(int pos,
char findChar)
Does not work if character being searched for is a '/' or a '*'
pos - Cursor positionfindChar - Character to search for
int _getLineStartPos(int pos)
pos - Any position on the current line
int _getLineEndPos(int pos)
pos - Any position on the current line
int _getLineFirstCharPos(int pos)
throws BadLocationException
pos - position on the line
BadLocationException
int getFirstNonWSCharPos(int pos)
throws BadLocationException
pos - Position to start from
BadLocationException
int getFirstNonWSCharPos(int pos,
boolean acceptComments)
throws BadLocationException
pos - Position to start fromacceptComments - if true, find non-whitespace chars in comments
BadLocationException
int getFirstNonWSCharPos(int pos,
char[] whitespace,
boolean acceptComments)
throws BadLocationException
pos - Position to start fromwhitespace - array of whitespace chars to ignoreacceptComments - if true, find non-whitespace chars in comments
BadLocationException
void insertString(int offset,
String str,
AttributeSet a)
throws BadLocationException
AbstractDJDocument.insertUpdate(javax.swing.text.AbstractDocument.DefaultDocumentEvent, javax.swing.text.AttributeSet).
insertString in interface AbstractDocumentInterfaceinsertString in interface DocumentBadLocationException
void remove(int offset,
int len)
throws BadLocationException
AbstractDJDocument.removeUpdate(javax.swing.text.AbstractDocument.DefaultDocumentEvent).
remove in interface AbstractDocumentInterfaceremove in interface DocumentBadLocationExceptionString getText()
getText in interface AbstractDocumentInterfacevoid clear()
ReducedModelControl getReduced()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||