This patch (committed) reimplements the paramString() method to provide better
debugging info, and adds API docs that were missing for a couple of methods:
2006-05-15 David Gilbert <[EMAIL PROTECTED]>
* javax/swing/JFileChooser.java
(paramString): Reimplemented,
(getAccessibleContext): Updated API docs,
(AccessibleJFileChooser): Added API docs.
Regards,
Dave
Index: javax/swing/JFileChooser.java
===================================================================
RCS file: /sources/classpath/classpath/javax/swing/JFileChooser.java,v
retrieving revision 1.30
diff -u -r1.30 JFileChooser.java
--- javax/swing/JFileChooser.java 10 Apr 2006 10:19:28 -0000 1.30
+++ javax/swing/JFileChooser.java 15 May 2006 04:47:25 -0000
@@ -1,5 +1,5 @@
/* JFileChooser.java --
- Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005, 2006, Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -1514,19 +1514,60 @@
}
/**
- * DOCUMENT ME!
+ * Returns a string describing the attributes for the
+ * <code>JFileChooser</code> component, for use in debugging. The return
+ * value is guaranteed to be non-<code>null</code>, but the format of the
+ * string may vary between implementations.
*
- * @return DOCUMENT ME!
+ * @return A string describing the attributes of the
+ * <code>JFileChooser</code>.
*/
protected String paramString()
{
- return "JFileChooser";
+ StringBuffer sb = new StringBuffer(super.paramString());
+ sb.append(",approveButtonText=");
+ if (approveButtonText != null)
+ sb.append(approveButtonText);
+ sb.append(",currentDirectory=");
+ if (currentDir != null)
+ sb.append(currentDir);
+ sb.append(",dialogTitle=");
+ if (dialogTitle != null)
+ sb.append(dialogTitle);
+ sb.append(",dialogType=");
+ if (dialogType == OPEN_DIALOG)
+ sb.append("OPEN_DIALOG");
+ if (dialogType == SAVE_DIALOG)
+ sb.append("SAVE_DIALOG");
+ if (dialogType == CUSTOM_DIALOG)
+ sb.append("CUSTOM_DIALOG");
+ sb.append(",fileSelectionMode=");
+ if (fileSelectionMode == FILES_ONLY)
+ sb.append("FILES_ONLY");
+ if (fileSelectionMode == DIRECTORIES_ONLY)
+ sb.append("DIRECTORIES_ONLY");
+ if (fileSelectionMode == FILES_AND_DIRECTORIES)
+ sb.append("FILES_AND_DIRECTORIES");
+ sb.append(",returnValue=");
+ if (retval == APPROVE_OPTION)
+ sb.append("APPROVE_OPTION");
+ if (retval == CANCEL_OPTION)
+ sb.append("CANCEL_OPTION");
+ if (retval == ERROR_OPTION)
+ sb.append("ERROR_OPTION");
+ sb.append(",selectedFile=");
+ if (selectedFile != null)
+ sb.append(selectedFile);
+ sb.append(",useFileHiding=").append(fileHiding);
+ return sb.toString();
}
/**
- * Returns the accessible context.
+ * Returns the object that provides accessibility features for this
+ * <code>JFileChooser</code> component.
*
- * @return The accessible context.
+ * @return The accessible context (an instance of
+ * [EMAIL PROTECTED] AccessibleJFileChooser}).
*/
public AccessibleContext getAccessibleContext()
{
@@ -1536,16 +1577,26 @@
}
/**
- * Accessibility support for JFileChooser
+ * Provides the accessibility features for the <code>JFileChooser</code>
+ * component.
*/
protected class AccessibleJFileChooser
extends JComponent.AccessibleJComponent
{
+ /**
+ * Creates a new instance of <code>AccessibleJFileChooser</code>.
+ */
protected AccessibleJFileChooser()
{
// Nothing to do here.
}
+ /**
+ * Returns the accessible role for the <code>JFileChooser</code>
+ * component.
+ *
+ * @return [EMAIL PROTECTED] AccessibleRole#FILE_CHOOSER}.
+ */
public AccessibleRole getAccessibleRole()
{
return AccessibleRole.FILE_CHOOSER;