net.atlanticbb.tantlinger.ui.text
Class IndentationFilter
java.lang.Object
javax.swing.text.DocumentFilter
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 classes/interfaces inherited from class javax.swing.text.DocumentFilter |
javax.swing.text.DocumentFilter.FilterBypass |
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 |
IndentationFilter
public IndentationFilter()
- Creates a filter that uses regular tabs and that auto indents
IndentationFilter
public IndentationFilter(boolean isSoftTabs,
boolean isAutoIndent)
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