edu.rice.cs.drjava.model.definitions.indent
Class ActionStartPrevLinePlusMultiline
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.ActionStartPrevLinePlusMultiline
- All Implemented Interfaces:
- IndentRule
class ActionStartPrevLinePlusMultiline
- extends IndentRuleAction
Indents the current line in the document to the indent level of the
start of the previous line, adds several lines of text at that indent level,
and moves the cursor to a particular line and position.
- Version:
- $Id: ActionStartPrevLinePlusMultiline.java 5236 2010-04-27 01:43:36Z mgricken $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_suffices
private java.lang.String[] _suffices
_line
private int _line
_offset
private int _offset
ActionStartPrevLinePlusMultiline
public ActionStartPrevLinePlusMultiline(java.lang.String[] suffices,
int line,
int position)
- Creates a multiline insert rule. It should be noted that although the suffices
are referred to as "lines", this class simply appends the strings with a
number of spaces for padding. Any newline characters you intend to place
in the document must be explicitly placed within the input strings.
Typically, all but the last "line" will have a '\n' character at the end.
- Parameters:
suffices - the new lines to be addedline - the line on which to place the cursorposition - the character within the line string before which to place
the cursor
- Throws:
java.lang.IllegalArgumentException - if the integer params are negative or
outside the appropriate bounds
indentLine
public boolean indentLine(AbstractDJDocument doc,
Indenter.IndentReason reason)
- Indents the line according to the previous line, with the suffix lines added and the cursor moved to a specific
location. If on the first line, indent is set to 0. 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