public void insertString(FilterBypass fb, int offs, String str, AttributeSet a) throws BadLocationException { if ("\n".equals(str)) { str = addWhiteSpace(fb.getDocument(), offs); if (fb.getDocument().getText(offs - 2, 1).equals("{")) { str = str + "Meow"; } } super.insertString(fb, offs, str, a); }
public void replace(FilterBypass fb, int offs, int length, String str, AttributeSet a) throws BadLocationException { if ("\n".equals(str)) str = addWhiteSpace(fb.getDocument(), offs); super.replace(fb, offs, length, str, a); }