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

java.lang.Object
  |
  +--edu.rice.cs.drjava.model.definitions.indent.IndentRuleAction
        |
        +--edu.rice.cs.drjava.model.definitions.indent.ActionStartPrevStmtPlus
All Implemented Interfaces:
IndentRule

public class ActionStartPrevStmtPlus
extends IndentRuleAction

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

Version:
$Id: ActionStartPrevStmtPlus.java,v 1.8 2002/07/22 22:50:41 csreis Exp $

Field Summary
private  String _suffix
           
private  boolean _useColon
           
 
Constructor Summary
ActionStartPrevStmtPlus(String suffix, boolean colonIsDelim)
          Constructs a new rule with the given suffix string.
 
Method Summary
private  boolean _isPrevNonWSCharEqualTo(DefinitionsDocument doc, int pos, char c)
           
 void indentLine(DefinitionsDocument doc)
          Properly indents the line that the caret is currently on.
 
Methods inherited from class edu.rice.cs.drjava.model.definitions.indent.IndentRuleAction
indentLine
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

_suffix

private String _suffix

_useColon

private boolean _useColon
Constructor Detail

ActionStartPrevStmtPlus

public ActionStartPrevStmtPlus(String suffix,
                               boolean colonIsDelim)
Constructs a new rule with the given suffix string.
Parameters:
suffix - String to append to indent level of brace
colonIsDelim - whether to include colons as statement delimiters
Method Detail

indentLine

public void indentLine(DefinitionsDocument doc)
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.
Overrides:
indentLine in class IndentRuleAction
Parameters:
doc - DefinitionsDocument containing the line to be indented.

_isPrevNonWSCharEqualTo

private boolean _isPrevNonWSCharEqualTo(DefinitionsDocument doc,
                                        int pos,
                                        char c)