edu.rice.cs.drjava.model.definitions.indent
Class ActionStartPrevLinePlusMultilinePreserve
java.lang.Object
edu.rice.cs.drjava.model.definitions.indent.IndentRuleWithTrace
edu.rice.cs.drjava.model.definitions.indent.IndentRuleAction
edu.rice.cs.drjava.model.definitions.indent.ActionStartPrevLinePlusMultilinePreserve
- All Implemented Interfaces:
- IndentRule
class ActionStartPrevLinePlusMultilinePreserve
- extends IndentRuleAction
Indents the current line in the document to the indent level of the
start of the previous line, preserving any text on the current line,
and adds several lines of text at that indent level,
and moves the cursor to a particular line and position.
- Version:
- $Id: ActionStartPrevLinePlusMultilinePreserve.java 5175 2010-01-20 08:46:32Z mgricken $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_suffices
private String[] _suffices
_cursorLine
private int _cursorLine
_cursorPos
private int _cursorPos
_psrvLine
private int _psrvLine
_psrvPos
private int _psrvPos
ActionStartPrevLinePlusMultilinePreserve
public ActionStartPrevLinePlusMultilinePreserve(String[] suffices,
int cursorLine,
int cursorPos,
int psrvLine,
int psrvPos)
- Creates a multiline insert rule, properly preserving any text on current line.
- Parameters:
suffices - the new lines to be addedcursorLine - the line on which to place the cursorcursorPos - the character within the line string before which to place
the cursorpsrvLine - the line in suffices on which to place the preserved textpsrvPos - the character within the line string in suffices before which
to place the preserved text
- Throws:
IllegalArgumentException - if the integer params are negative or
outside the appropriate bounds
indentLine
public boolean indentLine(AbstractDJDocument doc,
Indenter.IndentReason reason)
- Forwards the call to the enclosed ActionStartPrevLinePlusMultiline. Only runs in event thread.
- Specified by:
indentLine in interface IndentRule- Overrides:
indentLine in class IndentRuleWithTrace
- Parameters:
doc - AbstractDJDocument containing the line to be indented.reason - The reason that the indentation is taking place
- Returns:
- this is always false, since we are updating the cursor location