classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: Make JTextPane "work"


From: Mark Wielaard
Subject: [cp-patches] FYI: Make JTextPane "work"
Date: Thu, 30 Jun 2005 15:58:28 +0200

Hi,

This patch makes JTextPane "work" for programs (like JFreeChart) which
use it. Unfortunately it was (and still is) a complete stub. I was
tempted to just rip it out. But the JEditorPane.getEditorKit() fix is
real.

2005-06-30  Mark Wielaard  <address@hidden>

        * javax/swing/JEditorPane.java (getEditorKit): Call
        createDefaultEditorKit() and setEditorKit() when editorKit == null.
        * javax/swing/JTextPane.java: Call super for all methods where
        possible.

Thanks to Roman for helping with this on irc.

Committed,

Mark
Index: javax/swing/JEditorPane.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JEditorPane.java,v
retrieving revision 1.18
diff -u -r1.18 JEditorPane.java
--- javax/swing/JEditorPane.java        20 May 2005 19:30:10 -0000      1.18
+++ javax/swing/JEditorPane.java        30 Jun 2005 13:08:53 -0000
@@ -117,8 +117,14 @@
     return getEditorKit().getContentType();
   }
 
+  /**
+   * Returns the EditorKit. If there is no EditorKit set this method
+   * calls createDefaultEditorKit() and setEditorKit() first.
+   */
   public EditorKit getEditorKit()
   {
+    if (editorKit == null)
+      setEditorKit(createDefaultEditorKit());
     return editorKit;
   }
 
Index: javax/swing/JTextPane.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JTextPane.java,v
retrieving revision 1.3
diff -u -r1.3 JTextPane.java
--- javax/swing/JTextPane.java  22 Oct 2004 12:43:59 -0000      1.3
+++ javax/swing/JTextPane.java  30 Jun 2005 13:08:53 -0000
@@ -92,15 +92,6 @@
        //-------------------------------------------------------------
 
        /**
-        * writeObject
-        * @param stream TODO
-        * @exception IOException TODO
-        */
-       private void writeObject(ObjectOutputStream stream) throws IOException {
-               // TODO
-       } // writeObject()
-
-       /**
         * getUIClassID
         * @returns String
         */
@@ -113,7 +104,7 @@
         * @param document TODO
         */
        public void setDocument(Document document) {
-               // TODO
+               super.setDocument(document); // TODO
        } // setDocument()
 
        /**
@@ -137,7 +128,7 @@
         * @param content TODO
         */
        public void replaceSelection(String content) {
-               // TODO
+               super.replaceSelection(content); // TODO
        } // replaceSelection()
 
        /**
@@ -256,7 +247,7 @@
         * @returns EditorKit
         */
        protected EditorKit createDefaultEditorKit() {
-               return null; // TODO
+               return super.createDefaultEditorKit(); // TODO
        } // createDefaultEditorKit()
 
        /**
@@ -264,7 +255,7 @@
         * @param editor TODO
         */
        public final void setEditorKit(EditorKit editor) {
-               // TODO
+               super.setEditorKit(editor); // TODO
        } // setEditorKit()
 
        /**
@@ -272,7 +263,7 @@
         * @returns String
         */
        protected String paramString() {
-               return null; // TODO
+               return super.paramString(); // TODO
        } // paramString()
 
 

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]