diff options
author | Mark Wielaard <mark@gcc.gnu.org> | 2005-11-18 00:59:33 +0000 |
---|---|---|
committer | Mark Wielaard <mark@gcc.gnu.org> | 2005-11-18 00:59:33 +0000 |
commit | ca9e049bc145ae985bc0e2dd6079dacdd51717ac (patch) | |
tree | 4c44aaa3ed1ee1b4f15732664c05cfc9214e1fa9 /libjava/classpath/javax/swing/JEditorPane.java | |
parent | fb3a09c214e19c97d3751003d9a2ea8008f5005e (diff) | |
download | gcc-ca9e049bc145ae985bc0e2dd6079dacdd51717ac.zip gcc-ca9e049bc145ae985bc0e2dd6079dacdd51717ac.tar.gz gcc-ca9e049bc145ae985bc0e2dd6079dacdd51717ac.tar.bz2 |
Imported GNU Classpath gcj-import-20051117.
* gnu/java/net/protocol/file/Connection.java: Removed, fully merged.
* sources.am: Regenerated.
* Makefile.in: Likewise.
From-SVN: r107153
Diffstat (limited to 'libjava/classpath/javax/swing/JEditorPane.java')
-rw-r--r-- | libjava/classpath/javax/swing/JEditorPane.java | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/libjava/classpath/javax/swing/JEditorPane.java b/libjava/classpath/javax/swing/JEditorPane.java index 9ddf970..39f7c1f 100644 --- a/libjava/classpath/javax/swing/JEditorPane.java +++ b/libjava/classpath/javax/swing/JEditorPane.java @@ -59,6 +59,9 @@ import javax.swing.text.Document; import javax.swing.text.EditorKit; import javax.swing.text.Element; import javax.swing.text.JTextComponent; +import javax.swing.text.View; +import javax.swing.text.ViewFactory; +import javax.swing.text.WrappedPlainView; import javax.swing.text.html.HTML; import javax.swing.text.html.HTMLDocument; import javax.swing.text.html.HTMLEditorKit; @@ -466,6 +469,30 @@ public class JEditorPane extends JTextComponent } } + /** + * An EditorKit used for plain text. This is the default editor kit for + * JEditorPanes. + * + * @author Roman Kennke (kennke@aicas.com) + */ + private static class PlainEditorKit extends DefaultEditorKit + { + + /** + * Returns a ViewFactory that supplies WrappedPlainViews. + */ + public ViewFactory getViewFactory() + { + return new ViewFactory() + { + public View create(Element el) + { + return new WrappedPlainView(el); + } + }; + } + } + private static final long serialVersionUID = 3140472492599046285L; private URL page; @@ -497,12 +524,12 @@ public class JEditorPane extends JTextComponent protected EditorKit createDefaultEditorKit() { - return new DefaultEditorKit(); + return new PlainEditorKit(); } public static EditorKit createEditorKitForContentType(String type) { - return new DefaultEditorKit(); + return new PlainEditorKit(); } /** |