From: KUBO H. <hi...@sf...> - 2005-06-11 02:35:46
|
Hi, > --- xnap-commons.org/src/java/org/xnap/commons/gui/DirectoryChooser.java > 2005-05-04 12:53:28.000000000 +0900 > +++ xnap-commons/src/java/org/xnap/commons/gui/DirectoryChooser.java > 2005-06-04 11:01:35.000000000 +0900 > @@ -45,8 +45,8 @@ > implements TreeSelectionListener > { > - public static final int APPROVE_OPTION = 1; > - public static final int CANCEL_OPTION = 2; > + public static final int APPROVE_OPTION = 0; > + public static final int CANCEL_OPTION = 1; > > Is there a special reason why you changed these values? For compatibility to JFileChooser's definition of constants which have same names. > > But I think it will be required to make subclass of FileChooserDelegator > > which delegates method calls to a JFileChooser instances or > > an DirectoryChooser instance or something else chooser instance. > > Why not have a separate class for the directory chooser panel? We could > extract methods that can be shared between FileChooserPanel and > DirectoryChooserPanel to an abstract common super class. OK, I agree with you. When I wrote this patch, I tried to simulate JFileChooser#setFileSelectionMode (A dynamic mode change is required by calling setFileSelectionMode method), with reluctance. > I don't like the idea of boolean flags much. me too:) > And concerning FileDropAcceptableTextField.java: How about using a "decoration > pattern instead of inheritance" (as Felix put in chat). I'd prefer > implementing the DropTargetListener as an abstract class, requiring the > chooser panel to implement drop(File) and to set the filename instead of > inhereting JTextField. You're right. "the Decoratoin Pattern" will be better. I'll make abstract class DragTargetAdapter and class FileDragTargetAdapter. > Thanks for providing the patch. I think this will be a very useful enhancement > of the XNap Commons. Once we have figured out the technical details I am > certainly interested in merging it. You are welcome! -- KUBO Hiroya hi...@sf... |