This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[GUI] Patch: javax.swing.JEditorPane - javadocs


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,


I just commited the attached patch to rework javadocs in 
javax.swing.JEditorPane and implement one method.


Michael


2004-06-11  Michael Koch  <konqueror@gmx.de>

	* javax/swing/JEditorPane.java: Fixed javadocs.
	(JEditorPane): Removed redundant call to to this().
	(fireHyperlinkUpdate): Implemented.

- -- 
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAyVQBWSOgCCdjSDsRAv69AJ0TEn1EaxIETP+CbWhkPTY3LYCUUQCgiZIL
zFi6a4uc+bWaqGsYztXBn0E=
=Q7GD
-----END PGP SIGNATURE-----
Index: javax/swing/JEditorPane.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/JEditorPane.java,v
retrieving revision 1.5.2.2
diff -u -b -B -r1.5.2.2 JEditorPane.java
--- javax/swing/JEditorPane.java	10 Jun 2004 11:25:19 -0000	1.5.2.2
+++ javax/swing/JEditorPane.java	11 Jun 2004 06:33:54 -0000
@@ -53,6 +53,7 @@
 public class JEditorPane extends JTextComponent
 {
   private static final long serialVersionUID = 3140472492599046285L;
+  
   URL page_url;
   EditorKit kit;
   String ctype = "text/plain";
@@ -65,7 +66,6 @@
 
   public JEditorPane(String url) throws IOException
   {
-    this();
     setPage(url);
   }
 
@@ -90,8 +90,17 @@
     return new PlainEditorKit();
   }
 
-  public void fireHyperlinkUpdate(HyperlinkEvent e)
+  /**
+   * Sends a given <code>HyperlinkEvent</code> to all registered listeners.
+   *
+   * @param event the event to send
+   */
+  public void fireHyperlinkUpdate(HyperlinkEvent event)
   {
+    HyperlinkListener[] listeners = getHyperlinkListeners();
+
+    for (int index = 0; index < listeners.length; ++index)
+       listeners[index].hyperlinkUpdate(event);
   }
 
   public AccessibleContext getAccessibleContext()
@@ -119,9 +128,11 @@
     return kit;
   }
 
+  /**
+   * Returns the preferred size for the JEditorPane.  
+   */
   public Dimension getPreferredSize()
   {
-    //Returns the preferred size for the JEditorPane.  
     return super.getPreferredSize();
   }
 
@@ -178,42 +189,56 @@
     return "JEditorPane";
   }
 
+  /**
+   * Overridden to handle processing of tab/shift tab. 
+   */
   protected void processComponentKeyEvent(KeyEvent e)
   {
-    //Overridden to handle processing of tab/shift tab. 
   }
 
+  /**
+   * Make sure that TAB and Shift-TAB events get consumed, so that awt doesn't attempt focus traversal.  
+   */
   protected void processKeyEvent(KeyEvent e)
   {
-    //Make sure that TAB and Shift-TAB events get consumed, so that awt doesn't attempt focus traversal.  
   }
 
+  /**
+   * This method initializes from a stream. 
+   */
   public void read(InputStream in, Object desc)
   {
-    //This method initializes from a stream. 
   }
 
+  /**
+   * Establishes the default bindings of type to classname. 
+   */
   public static void registerEditorKitForContentType(String type,
                                                      String classname)
   {
-    //Establishes the default bindings of type to classname. 
   }
 
+  /**
+   * Establishes the default bindings of type to classname.  
+   */
   public static void registerEditorKitForContentType(String type,
                                                      String classname,
                                                      ClassLoader loader)
   {
-    //Establishes the default bindings of type to classname.  
   }
 
+  /**
+   * Replaces the currently selected content with new content represented by the given string. 
+   */
   public void replaceSelection(String content)
   {
-    //Replaces the currently selected content with new content represented by the given string. 
   }
 
+  /**
+   * Scrolls the view to the given reference location (that is, the value returned by the UL.getRef method for the URL being displayed).  
+   */
   protected void scrollToReference(String reference)
   {
-    //Scrolls the view to the given reference location (that is, the value returned by the UL.getRef method for the URL being displayed).  
   }
 
   public void setContentType(String type)
@@ -236,14 +261,18 @@
     setEditorKit(k);
   }
 
+  /**
+   * Sets the current URL being displayed.  
+   */
   public void setPage(String url) throws IOException
   {
-    //  Sets the current URL being displayed.  
   }
 
+  /**
+   * Sets the current URL being displayed.  
+   */
   public void setPage(URL page) throws IOException
   {
-    //    Sets the current URL being displayed.  
   }
 
   public void setText(String t)
@@ -251,17 +280,31 @@
     super.setText(t);
   }
 
+  /**
+   * Add a <code>HyperlinkListener</code> object to this editor pane.
+   *
+   * @param listener the listener to add
+   */
   public void addHyperlinkListener(HyperlinkListener listener)
   {
     listenerList.add(HyperlinkListener.class, listener);
   }
 
+  /**
+   * Removes a <code>HyperlinkListener</code> object to this editor pane.
+   *
+   * @param listener the listener to remove
+   */
   public void removeHyperlinkListener(HyperlinkListener listener)
   {
     listenerList.remove(HyperlinkListener.class, listener);
   }
 
   /**
+   * Returns all added <code>HyperlinkListener</code> objects.
+   *
+   * @return array of listeners
+   *
    * @since 1.4
    */
   public HyperlinkListener[] getHyperlinkListeners()

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]