edu.rice.cs.drjava.model.definitions.indent
Class Indenter
java.lang.Object
edu.rice.cs.drjava.model.definitions.indent.Indenter
public class Indenter
- extends Object
Singleton class to construct and use the indentation decision tree.
- Version:
- $Id: Indenter.java 4691 2008-12-02 23:33:27Z dlsmith $
Nested Class Summary |
static class |
Indenter.IndentReason
Enumeration of reasons why indentation may be preformed. |
Constructor Summary |
Indenter(int indentLevel)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_indentLevel
protected int _indentLevel
_topRule
protected IndentRule _topRule
- Root of decision tree.
Indenter
public Indenter(int indentLevel)
getIndentLevel
public int getIndentLevel()
buildTree
public void buildTree(int indentLevel)
- Builds the decision tree for indentation.
For now, this method needs to be called every time the size of one indent level is being changed!
indent
public boolean indent(AbstractDJDocument doc,
Indenter.IndentReason reason)
- Indents the current line based on a decision tree which determines the indent based on context.
- Parameters:
doc
- document containing line to be indented Assumes that reduced lock is already held.
- Returns:
- true if the condition tested by the top rule holds, false otherwise