edu.rice.cs.drjava.model.definitions.indent
Class ActionBracePlus
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.ActionBracePlus
- All Implemented Interfaces:
- IndentRule
public class ActionBracePlus
- extends IndentRuleAction
Aligns indentation of the current line to the character that opened the enclosing block or expression list.
Optional additional whitespaces can be passed through the constructor.
- Version:
- $Id: ActionBracePlus.java 5175 2010-01-20 08:46:32Z mgricken $
|
Field Summary |
private int |
_suffixCt
int holding the number of additional blanks to be inserted. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_suffixCt
private int _suffixCt
- int holding the number of additional blanks to be inserted.
ActionBracePlus
public ActionBracePlus(int ct)
- Parameters:
ct - The additional whitespaces to be inserted.
indentLine
public boolean indentLine(AbstractDJDocument doc,
Indenter.IndentReason reason)
- Properly indents the line that the caret is currently on. Replaces all whitespace characters at the beginning of
the line with the appropriate spacing or characters.
Preconditions: must be inside a brace.
- Specified by:
indentLine in interface IndentRule- Overrides:
indentLine in class IndentRuleWithTrace
- Parameters:
doc - AbstractDJDocument containing the line to be indented.reason - The reason that indentation was initiated, specified in Indenter
- Returns:
- true if the caller should update the current location, false if the indenter has already done this.