|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rice.cs.drjava.model.definitions.reducedmodel.AbstractReducedModel
edu.rice.cs.drjava.model.definitions.reducedmodel.ReducedModelComment
public class ReducedModelComment
Keeps track of newlines, comment blocks, and single and double-quoted strings. This reduced sub-model is used for coloring purposes. Given the information contained here, the DefinitionsEditorKit can paint strings, comments, and regular code in different colors. DefinitionsEditorKit colors keywords by directly reading DefinitionsDocument, the "full-scale" model.
Field Summary |
---|
Fields inherited from class edu.rice.cs.drjava.model.definitions.reducedmodel.AbstractReducedModel |
---|
PTR_CHAR |
Fields inherited from interface edu.rice.cs.drjava.model.definitions.reducedmodel.ReducedModelStates |
---|
FREE, INSIDE_BLOCK_COMMENT, INSIDE_DOUBLE_QUOTE, INSIDE_LINE_COMMENT, INSIDE_SINGLE_QUOTE, STUTTER |
Constructor Summary | |
---|---|
ReducedModelComment()
Constructor. |
Method Summary | |
---|---|
void |
delete(int count)
Update the BraceReduction to reflect text deletion. |
int |
getDistToNextNewline()
Returns the distance to the gap before the next newline (end of document if no newline) |
int |
getDistToStart()
Gets distance to the previous newline character (not including newline char). |
int |
getDistToStart(int relLoc)
Returns distance to previous newline where relLoc is the distance back from the cursor to start searching. |
ReducedModelState |
getStateAtCurrent()
Returns the state of the _cursor iterator. |
void |
insertChar(char ch)
Inserts a character into the reduced model. |
protected void |
insertGapBetweenMultiCharBrace(int length)
Inserts a gap between the characters in a multiple character brace. |
void |
insertNewline()
Inserts an end-of-line character. |
void |
insertQuote(String quote)
Inserts the specified quote character. |
boolean |
isOpenComment()
|
boolean |
isShadowed()
|
boolean |
isWeaklyShadowed()
|
void |
move(int count)
Updates the BraceReduction to reflect cursor movement. |
protected ReducedModelState |
moveWalkerGetState(int relLocation)
Returns the state at the relLocation, where relLocation is the location relative to the walker |
protected void |
resetWalkerLocationToCursor()
Resets the walker to the current position in document |
int |
walkerOffset()
|
Methods inherited from class edu.rice.cs.drjava.model.definitions.reducedmodel.AbstractReducedModel |
---|
_augmentCurrentGap, _augmentGapToLeft, _gapToLeft, _gapToRight, _insertGap, _insertNewGap, absOffset, absOffset, current, getLength, getState, makeCopyCursor, next, prev, simpleString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReducedModelComment()
Method Detail |
---|
public void insertChar(char ch)
AbstractReducedModel
insertChar
in class AbstractReducedModel
public void insertNewline()
public void insertQuote(String quote)
quote
- the type of quote to insertpublic ReducedModelState getStateAtCurrent()
public int walkerOffset()
protected void insertGapBetweenMultiCharBrace(int length)
insertGapBetweenMultiCharBrace
in class AbstractReducedModel
length
- the size of the Gap to be inserted in characterspublic void move(int count)
count
- indicates the direction and magnitude of cursor movementpublic void delete(int count)
Update the BraceReduction to reflect text deletion.
Negative values delete text to the left of the cursor, positive values delete text to the right. Always move count spaces to make sure we can delete.
count
- indicates the size and direction of text deletion.public boolean isShadowed()
public boolean isWeaklyShadowed()
public boolean isOpenComment()
protected ReducedModelState moveWalkerGetState(int relLocation)
moveWalkerGetState
in class AbstractReducedModel
relLocation
- distance from walker to get state at.protected void resetWalkerLocationToCursor()
resetWalkerLocationToCursor
in class AbstractReducedModel
public int getDistToStart()
public int getDistToStart(int relLoc)
public int getDistToNextNewline()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |