/[classpath]/classpath/javax/swing/text/PlainDocument.java
ViewVC logotype

Diff of /classpath/javax/swing/text/PlainDocument.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by abalkiss, Fri Sep 30 17:49:48 2005 UTC revision 1.15 by rabbit78, Thu Oct 27 14:53:42 2005 UTC
# Line 147  public class PlainDocument extends Abstr Line 147  public class PlainDocument extends Abstr
147      Element root = getDefaultRootElement();      Element root = getDefaultRootElement();
148      return root.getElement(root.getElementIndex(pos));      return root.getElement(root.getElementIndex(pos));
149    }    }
150    
151      /**
152       * Inserts a string into the document. If the document property
153       * '<code>filterNewLines</code>' is set to <code>Boolean.TRUE</code>, then
154       * all newlines in the inserted string are replaced by space characters,
155       * otherwise the superclasses behaviour is executed.
156       *
157       * Inserting content causes a write lock to be acquired during this method
158       * call.
159       *
160       * @param offs the offset at which to insert the string
161       * @param str the string to be inserted
162       * @param atts the text attributes of the string to be inserted
163       *
164       * @throws BadLocationException
165       */
166      public void insertString(int offs, String str, AttributeSet atts)
167        throws BadLocationException
168      {
169        String string = str;
170        if (Boolean.TRUE.equals(getProperty("filterNewlines")))
171          string = str.replaceAll("\n", " ");
172        super.insertString(offs, string, atts);
173      }
174  }  }

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26