com.cburch.editor
Class AutoIndent

java.lang.Object
  extended by com.cburch.editor.AutoIndent

public class AutoIndent
extends java.lang.Object

Handles the automatic indentation as the user types.

Version:
0.1 2005-05-31
Author:
Carl Burch

Constructor Summary
AutoIndent(Editor editor, TokenType openBrace, TokenType closeBrace, char closeBraceChar)
          Constructs automatic indentation for the given editor.
 
Method Summary
 boolean isEnabled()
          Returns true the automatic indentation is currently enabled.
 void setEnabled(boolean value)
          Controls whether the indentation takes place.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutoIndent

public AutoIndent(Editor editor,
                  TokenType openBrace,
                  TokenType closeBrace,
                  char closeBraceChar)
Constructs automatic indentation for the given editor.

Parameters:
editor - the editor for which we will perform automatic indentation.
openBrace - the token we use for identifying opening braces.
closeBrace - the token we use for identifying closing braces.
closeBraceChar - the character corresponding to closing braces.
Method Detail

isEnabled

public boolean isEnabled()
Returns true the automatic indentation is currently enabled.

Returns:
true if the indentation is enabled.

setEnabled

public void setEnabled(boolean value)
Controls whether the indentation takes place.

Parameters:
value - true if automatic indentation should take place, false if it should be disabled.