<Swing Dev> Fwd: The file list in JFileChooser does not have an accessible name.
Pavel Porvatov
pavel.porvatov at oracle.com
Fri Sep 2 10:41:13 UTC 2011
Hi Charles,
> On 09/01/2011 08:37 PM, Pavel Porvatov wrote:
>> Hi Charles,
>>> On 08/25/2011 05:45 PM, Pavel Porvatov wrote:
>>>>
>>> putClientProperty still does not work on my side. I can not find
>>> methods which receive the accessible property changes. Is the diff
>>> attached you supposed to be?
>> Take a look at
>> javax.swing.JComponent.AccessibleJComponent#getAccessibleName
>>
>> ...
>> if (name == null) {
>> name =
>> (String)getClientProperty(AccessibleContext.ACCESSIBLE_NAME_PROPERTY);
>> }
>> ...
>>
>>
>> Below is FilePane patch that works on my PC:
>>
>> # hg diff src/share/classes/sun/swing/FilePane.java
>> diff --git a/src/share/classes/sun/swing/FilePane.java
>> b/src/share/classes/sun/swing/FilePane.java
>> --- a/src/share/classes/sun/swing/FilePane.java
>> +++ b/src/share/classes/sun/swing/FilePane.java
>> @@ -35,6 +35,7 @@
>> import java.util.List;
>> import java.util.concurrent.Callable;
>>
>> +import javax.accessibility.AccessibleContext;
>> import javax.swing.*;
>> import javax.swing.border.*;
>> import javax.swing.event.*;
>> @@ -82,6 +83,8 @@
>> private JPanel currentViewPanel;
>> private String[] viewTypeActionNames;
>>
>> + private String filesListAccessibleName = null;
>> +
>> private JPopupMenu contextMenu;
>> private JMenu viewMenu;
>>
>> @@ -450,6 +453,8 @@
>> gigaByteString =
>> UIManager.getString("FileChooser.fileSizeGigaBytes", l);
>> fullRowSelection =
>> UIManager.getBoolean("FileView.fullRowSelection");
>>
>> + filesListAccessibleName =
>> UIManager.getString("FileChooser.filesListAccessibleName",l);
>> +
>> renameErrorTitleText =
>> UIManager.getString("FileChooser.renameErrorTitleText", l);
>> renameErrorText =
>> UIManager.getString("FileChooser.renameErrorText", l);
>> renameErrorFileExistsText =
>> UIManager.getString("FileChooser.renameErrorFileExistsText", l);
>> @@ -634,6 +639,9 @@
>> if (listViewBorder != null) {
>> scrollpane.setBorder(listViewBorder);
>> }
>> +
>> +
>> list.putClientProperty(AccessibleContext.ACCESSIBLE_NAME_PROPERTY,
>> filesListAccessibleName);
>> +
>> p.add(scrollpane, BorderLayout.CENTER);
>> return p;
>> }
>>
>> I used attached test for checking...
>>
>> Regards, Pavel
> Great, it works, though I do not know why it does not work before....
>
> So, Pavel my question is still there:
>
> I do not get "There is no AccessibleDescription for all resources". Do
> you mean it is not in all the resource file (*.properties) or do you
> mean not all accessible class has accessible description?
I meant that we don't add accessible descriptions, therefore I'd like to
remove FileChooser.filesAccessibleDescription from the patch.
Regards, Pavel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20110902/3cbc1242/attachment.html>
More information about the swing-dev
mailing list