Hello Anthony, 2010/5/5 Anthony Petrov <[email protected]>: > So I suggest to introduce a new class java.awt.DirectoryDialog. This class > would provide a well-suited API for directory selection operation. Also > we'll have to introduce a DirectoryDialogPeer at the java.awt.peer package, > and, of course, its implementations in the platform-specific code. For GTK > we could have a base class that's able to display a generic GTK > file-chooser, and this peer may be extended for the FileDilaogPeer and > DirDialogPeer implementations. Does this sound reasonable?
Under GTK (differently from Windows), the API is the same: you have just to specify GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER instead of GTK_FILE_CHOOSER_ACTION_OPEN [1]. Anyway using a separate class and peer, as you suggest, it also possible and GtkDirectoryDialogPeer can extend the GtkFileDialogPeer. Now it remains to specify "a well-suited API" for the DirectoryDialog. I think, this is a task for you, and then Damjan and I can begin to write the peers for X11, GTK and Windows. Best Regards, Costantino [1] http://library.gnome.org/devel/gtk/stable/GtkFileChooser.html#GtkFileChooserAction
