net.atlanticbb.tantlinger.ui.text
Class IndentationFilter

java.lang.Object
  extended by javax.swing.text.DocumentFilter
      extended by net.atlanticbb.tantlinger.ui.text.IndentationFilter

public class IndentationFilter
extends javax.swing.text.DocumentFilter

DocumentFilter which manages auto indentation and soft tabs.

Author:
Bob Tantlinger

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.text.DocumentFilter
javax.swing.text.DocumentFilter.FilterBypass
 
Constructor Summary
IndentationFilter()
          Creates a filter that uses regular tabs and that auto indents
IndentationFilter(boolean isSoftTabs, boolean isAutoIndent)
           
 
Method Summary
 boolean isAutoIndent()
           
 boolean isSoftTabs()
           
 void replace(javax.swing.text.DocumentFilter.FilterBypass fb, int offset, int length, java.lang.String text, javax.swing.text.AttributeSet attrs)
           
 void setAutoIndent(boolean isAutoIndent)
           
 void setSoftTabs(boolean isSoftTabs)
           
 
Methods inherited from class javax.swing.text.DocumentFilter
insertString, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndentationFilter

public IndentationFilter()
Creates a filter that uses regular tabs and that auto indents


IndentationFilter

public IndentationFilter(boolean isSoftTabs,
                         boolean isAutoIndent)
Method Detail

replace

public void replace(javax.swing.text.DocumentFilter.FilterBypass fb,
                    int offset,
                    int length,
                    java.lang.String text,
                    javax.swing.text.AttributeSet attrs)
             throws javax.swing.text.BadLocationException
Overrides:
replace in class javax.swing.text.DocumentFilter
Throws:
javax.swing.text.BadLocationException

isAutoIndent

public boolean isAutoIndent()
Returns:
the isAutoIndent

setAutoIndent

public void setAutoIndent(boolean isAutoIndent)
Parameters:
isAutoIndent - the isAutoIndent to set

isSoftTabs

public boolean isSoftTabs()
Returns:
the isSoftTabs

setSoftTabs

public void setSoftTabs(boolean isSoftTabs)
Parameters:
isSoftTabs - the isSoftTabs to set