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

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.ActionStartPrevLinePlus
All Implemented Interfaces:
IndentRule

 class ActionStartPrevLinePlus
extends IndentRuleAction

Indents current line to the indent level of the previous line augmented by a suffix.

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

Field Summary
private  java.lang.String _suffix
           
 
Fields inherited from class edu.rice.cs.drjava.model.definitions.indent.IndentRuleWithTrace
NO, TERMINUS_RULE, YES
 
Constructor Summary
ActionStartPrevLinePlus(java.lang.String suffix)
          Repeats the indentation from the previous line augmented by a suffix
 
Method Summary
 boolean indentLine(AbstractDJDocument doc, Indenter.IndentReason reason)
          Indents the line according to the previous line, with the suffix string added.
 
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 java.lang.String _suffix
Constructor Detail

ActionStartPrevLinePlus

public ActionStartPrevLinePlus(java.lang.String suffix)
Repeats the indentation from the previous line augmented by a suffix

Parameters:
suffix - The string to be added
Method Detail

indentLine

public boolean indentLine(AbstractDJDocument doc,
                          Indenter.IndentReason reason)
Indents the line according to the previous line, with the suffix string added. 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:
true if the caller should update the current location, false if the indenter has already done it