if (Boolean.TRUE.equals(getProperty("filterNewlines")))
if (str != null && Boolean.TRUE.equals(getProperty("filterNewlines")))
  public void insertString(int offs, String str, AttributeSet atts)    throws BadLocationException  {    String string = str;    if (Boolean.TRUE.equals(getProperty("filterNewlines")))      string = str.replaceAll("\n", " ");    super.insertString(offs, string, atts);  }