edu.rice.cs.drjava.model.definitions.indent
Class ActionStartCurrStmtPlus

java.lang.Object
  extended by edu.rice.cs.drjava.model.definitions.indent.IndentRuleWithTrace
      extended by edu.rice.cs.drjava.model.definitions.indent.IndentRuleAction
          extended by edu.rice.cs.drjava.model.definitions.indent.ActionStartCurrStmtPlus
All Implemented Interfaces:
IndentRule

public class ActionStartCurrStmtPlus
extends IndentRuleAction

Indents the current line in the document to the indent level of the start of the statement that the cursor is currently on, plus the given suffix string.

Version:
$Id: ActionStartCurrStmtPlus.java 5175 2010-01-20 08:46:32Z mgricken $

Field Summary
private  int _suffix
           
 
Fields inherited from class edu.rice.cs.drjava.model.definitions.indent.IndentRuleWithTrace
NO, TERMINUS_RULE, YES
 
Constructor Summary
ActionStartCurrStmtPlus(int suffix)
          Constructs a new rule with the given suffix string.
 
Method Summary
 boolean indentLine(AbstractDJDocument doc, Indenter.IndentReason reason)
          Properly indents the line that the caret is currently on.
 
Methods inherited from class edu.rice.cs.drjava.model.definitions.indent.IndentRuleWithTrace
_addToIndentTrace, getRuleName, getTrace, indentLine, printLastIndentTrace, setRuleTraceEnabled, testIndentLine, testIndentLine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_suffix

private int _suffix
Constructor Detail

ActionStartCurrStmtPlus

public ActionStartCurrStmtPlus(int suffix)
Constructs a new rule with the given suffix string.

Parameters:
suffix - String to append to indent level of brace
Method Detail

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.

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 indentition is taking place
Returns:
true if the caller should update the current location itself, false if the indenter has already handled this