Bug 27606 - No indentation of the directories in JFileChooser
Summary: No indentation of the directories in JFileChooser
Status: RESOLVED FIXED
Alias: None
Product: classpath
Classification: Unclassified
Component: swing (show other bugs)
Version: unspecified
: P3 normal
Target Milestone: 0.92
Assignee: Roman Kennke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-14 17:44 UTC by Yvan Norsa
Modified: 2006-08-02 21:48 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Partial fix (663 bytes, patch)
2006-05-14 18:05 UTC, Yvan Norsa
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yvan Norsa 2006-05-14 17:44:14 UTC
The directory combobox in the JFileChooser should indent the directories, in a tree-like way.
Comment 1 Yvan Norsa 2006-05-14 18:05:13 UTC
Created attachment 11466 [details]
Partial fix

This patch fixes partially the problem by indenting the directory name. But in the RI, the whole JLabel is indented (the icon is right near the text), so I guess we should try to do the same, but I do not know how.
Comment 2 cvs-commit@developer.classpath.org 2006-08-02 21:47:05 UTC
Subject: Bug 27606

CVSROOT:	/cvsroot/classpath
Module name:	classpath
Changes by:	Roman Kennke <rabbit78>	06/08/02 21:46:17

Modified files:
	javax/swing/plaf/metal: MetalFileChooserUI.java 
	javax/swing/plaf/basic: BasicListUI.java 
	.              : ChangeLog 

Log message:
	2006-08-02  Roman Kennke  <kennke@aicas.com>
	
		PR 27606
		* javax/swing/plaf/basic/BasicListUI.java
		(paintCell): Pass row index to cell renderer.
		* javax/swing/plaf/basic/MetalFileChooserUI.java
		(DirectoryComboBoxRenderer.indentIcon): New field.
		(DirectoryComboBoxRenderer.DirectoryComboBoxRenderer):
		Initialize indentIcon.
		(DirectoryComboBoxRenderer.getListCellRendererComponent):
		Fall back to super and removed standard functionality.
		Handle indentation.
		(IndentIcon): New class. Wraps and indents another icon.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/plaf/metal/MetalFileChooserUI.java?cvsroot=classpath&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/plaf/basic/BasicListUI.java?cvsroot=classpath&r1=1.59&r2=1.60
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&r1=1.8299&r2=1.8300



Comment 3 Roman Kennke 2006-08-02 21:48:32 UTC
Fixed in CVS by installing an IndentIcon, that wraps another icon and adds indentation to it.
Comment 4 cvs-commit@developer.classpath.org 2006-08-04 00:45:13 UTC
Subject: Bug 27606

CVSROOT:	/cvsroot/classpath
Module name:	classpath
Branch:		generics-branch
Changes by:	Mark Wielaard <mark>	06/08/04 00:43:45

Modified files:
	.              : ChangeLog 
	javax/swing    : JComboBox.java 
	javax/swing/filechooser: FileSystemView.java 
	                         UnixFileSystemView.java 
	javax/swing/plaf/basic: BasicDirectoryModel.java 
	                        BasicFileChooserUI.java BasicListUI.java 
	javax/swing/plaf/metal: MetalFileChooserUI.java 

Log message:
	2006-08-03  Roman Kennke  <kennke@aicas.com>
	
		PR 27606
		* javax/swing/plaf/basic/BasicListUI.java
		(paintCell): Pass row index to cell renderer.
		* javax/swing/plaf/basic/MetalFileChooserUI.java
		(DirectoryComboBoxRenderer.indentIcon): New field.
		(DirectoryComboBoxRenderer.DirectoryComboBoxRenderer):
		Initialize indentIcon.
		(DirectoryComboBoxRenderer.getListCellRendererComponent):
		Fall back to super and removed standard functionality.
		Handle indentation.
		(IndentIcon): New class. Wraps and indents another icon.
	
	2006-08-03  Roman Kennke  <kennke@aicas.com>
	
		PR 27605
		* javax/swing/JComboBox.java
		(setSelectedItem): Fire ActionEvent here.
		* javax/swing/plaf/basic/BasicDirectoryModel.java
		(directories): Changed to type Vector.
		(files): New field.
		(loadThread): New field.
		(DirectoryLoadThread): New inner class. This loads the contents
		of directories asynchronously.
		(getDirectories): Return cached Vector.
		(getFiles): Return cached Vector.
		(getSize): Return plain size of contents Vector.
		(propertyChange): Reread directory also for DIRECTORY_CHANGED,
		FILE_FILTER_CHANGED, FILE_HIDING_CHANGED and FILE_VIEW_CHANGED.
		(sort): Don't store sorted list in contents. This must be done
		asynchronously from the EventThread.
		(validateFileCache): Rewritten for asynchronous reading
		of directory contents.
		* javax/swing/plaf/basic/BasicFileChooserUI.java
		(installListeners): Install model as PropertyChangeListener.
		(uninstallListeners): Uninstall model as PropertyChangeListener.
		(createPropertyChangeListener): Return null just like the
		RI.
	
	2006-08-03  Roman Kennke  <kennke@aicas.com>
	
		PR 27604
		* javax/swing/plaf/basic/BasicChooserUI.java
		(BasicFileView.getName): Fetch the real name from the
		file chooser's FileSystemView.
		* javax/swing/plaf/metal/MetalChooserUI.java
		(DirectoryComboBoxRenderer.getListCellRendererComponent):
		Set the text fetched from the JFileChooser.getName().
		* javax/swing/FileSystemView.java
		(createFileObject): When file is a filesystem root,
		create a filesystem root object first.
		(getSystemDisplayName): Return the filename. Added specnote
		about ShellFolder class that is mentioned in the spec.
		* javax/swing/UnixFileSystemView.java
		(getSystemDisplayName): Implemented to return the real name
		of a file, special handling files like '.' or '..'.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&only_with_tag=generics-branch&r1=1.2386.2.307&r2=1.2386.2.308
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/JComboBox.java?cvsroot=classpath&only_with_tag=generics-branch&r1=1.8.2.16&r2=1.8.2.17
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/filechooser/FileSystemView.java?cvsroot=classpath&only_with_tag=generics-branch&r1=1.3.2.5&r2=1.3.2.6
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/filechooser/UnixFileSystemView.java?cvsroot=classpath&only_with_tag=generics-branch&r1=1.1.2.4&r2=1.1.2.5
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/plaf/basic/BasicDirectoryModel.java?cvsroot=classpath&only_with_tag=generics-branch&r1=1.1.2.5&r2=1.1.2.6
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java?cvsroot=classpath&only_with_tag=generics-branch&r1=1.2.2.13&r2=1.2.2.14
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/plaf/basic/BasicListUI.java?cvsroot=classpath&only_with_tag=generics-branch&r1=1.9.2.15&r2=1.9.2.16
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/plaf/metal/MetalFileChooserUI.java?cvsroot=classpath&only_with_tag=generics-branch&r1=1.3.2.8&r2=1.3.2.9



Comment 5 cvs-commit@developer.classpath.org 2006-08-04 00:45:16 UTC
Subject: Bug 27606

CVSROOT:	/cvsroot/classpath
Module name:	classpath
Branch:		classpath-0_92-branch
Changes by:	Mark Wielaard <mark>	06/08/04 00:43:31

Modified files:
	.              : ChangeLog 
	javax/swing    : JComboBox.java 
	javax/swing/filechooser: FileSystemView.java 
	                         UnixFileSystemView.java 
	javax/swing/plaf/basic: BasicDirectoryModel.java 
	                        BasicFileChooserUI.java BasicListUI.java 
	javax/swing/plaf/metal: MetalFileChooserUI.java 

Log message:
	2006-08-03  Roman Kennke  <kennke@aicas.com>
	
		PR 27606
		* javax/swing/plaf/basic/BasicListUI.java
		(paintCell): Pass row index to cell renderer.
		* javax/swing/plaf/basic/MetalFileChooserUI.java
		(DirectoryComboBoxRenderer.indentIcon): New field.
		(DirectoryComboBoxRenderer.DirectoryComboBoxRenderer):
		Initialize indentIcon.
		(DirectoryComboBoxRenderer.getListCellRendererComponent):
		Fall back to super and removed standard functionality.
		Handle indentation.
		(IndentIcon): New class. Wraps and indents another icon.
	
	2006-08-03  Roman Kennke  <kennke@aicas.com>
	
		PR 27605
		* javax/swing/JComboBox.java
		(setSelectedItem): Fire ActionEvent here.
		* javax/swing/plaf/basic/BasicDirectoryModel.java
		(directories): Changed to type Vector.
		(files): New field.
		(loadThread): New field.
		(DirectoryLoadThread): New inner class. This loads the contents
		of directories asynchronously.
		(getDirectories): Return cached Vector.
		(getFiles): Return cached Vector.
		(getSize): Return plain size of contents Vector.
		(propertyChange): Reread directory also for DIRECTORY_CHANGED,
		FILE_FILTER_CHANGED, FILE_HIDING_CHANGED and FILE_VIEW_CHANGED.
		(sort): Don't store sorted list in contents. This must be done
		asynchronously from the EventThread.
		(validateFileCache): Rewritten for asynchronous reading
		of directory contents.
		* javax/swing/plaf/basic/BasicFileChooserUI.java
		(installListeners): Install model as PropertyChangeListener.
		(uninstallListeners): Uninstall model as PropertyChangeListener.
		(createPropertyChangeListener): Return null just like the
		RI.
	
	2006-08-03  Roman Kennke  <kennke@aicas.com>
	
		PR 27604
		* javax/swing/plaf/basic/BasicChooserUI.java
		(BasicFileView.getName): Fetch the real name from the
		file chooser's FileSystemView.
		* javax/swing/plaf/metal/MetalChooserUI.java
		(DirectoryComboBoxRenderer.getListCellRendererComponent):
		Set the text fetched from the JFileChooser.getName().
		* javax/swing/FileSystemView.java
		(createFileObject): When file is a filesystem root,
		create a filesystem root object first.
		(getSystemDisplayName): Return the filename. Added specnote
		about ShellFolder class that is mentioned in the spec.
		* javax/swing/UnixFileSystemView.java
		(getSystemDisplayName): Implemented to return the real name
		of a file, special handling files like '.' or '..'.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&only_with_tag=classpath-0_92-branch&r1=1.8251.2.16&r2=1.8251.2.17
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/JComboBox.java?cvsroot=classpath&only_with_tag=classpath-0_92-branch&r1=1.33&r2=1.33.2.1
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/filechooser/FileSystemView.java?cvsroot=classpath&only_with_tag=classpath-0_92-branch&r1=1.10&r2=1.10.10.1
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/filechooser/UnixFileSystemView.java?cvsroot=classpath&only_with_tag=classpath-0_92-branch&r1=1.4&r2=1.4.4.1
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/plaf/basic/BasicDirectoryModel.java?cvsroot=classpath&only_with_tag=classpath-0_92-branch&r1=1.4&r2=1.4.2.1
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java?cvsroot=classpath&only_with_tag=classpath-0_92-branch&r1=1.27&r2=1.27.2.1
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/plaf/basic/BasicListUI.java?cvsroot=classpath&only_with_tag=classpath-0_92-branch&r1=1.59&r2=1.59.2.1
http://cvs.savannah.gnu.org/viewcvs/classpath/javax/swing/plaf/metal/MetalFileChooserUI.java?cvsroot=classpath&only_with_tag=classpath-0_92-branch&r1=1.24&r2=1.24.2.1