Thanks for this new version of the auto-completer! This version fixes all of the issues I had previously reported by email.
I'm glad to report that your patch has been committed, the auto-completion will be in the next nightly build. Please note that I made the following minor changes :
- moved BookmarkManager#getSortedBookmarksNames() to LocationCompleter as it currently is used only by this class and is a somewhat specialized method. Same goes for RootFolders#getSortedRootFoldersNames(), except that this method is also used by FileCompleter so I had to make it public static, not pretty :) Maybe those two methods could be moved to a util class, or LocationCompleter could derive from FileCompleter since they share a lot of code. Just some thoughts.
- I've noticed a minor issue under Mac OS X while testing: the suggestion popup would sometimes show an horizontal scrollbar even though there is plenty enough horizontal space to display the suggestion list (see attached screenshot). To work around this problem, I have set the JScrollPane's horizontal policy to NEVER. It is rather unlikely that the list/popup's width will exceed the screen width so it shouldn't be a problem.
- commented the two lines you added to LocationComboBox#focusLost that ensure the text field's text is set to the current directory's path. It used to be this way before but it had the annoying side effect of resetting the text field's contents when you switched to another application. Sometimes you start typing a path and then need to check something in another application, go back to muCommander and finish typing. In that case, you don't want to lose your half-entered path and start all over again.
As it currently is, you can end up having the location field's text set to a value that doesn't correspond to the current folder (or to any folder for that matter) but I don't think it's that big of an issue. Please let me know if that is a problem for the auto-completer or if you have another idea regarding this.
I have a suggestion regarding the auto-completion in the location field. It currently suggests regular / non-browsable files (in addition to browsable files), which is not really necessary in the case of the location field, unlike in the copy/move/... dialogs where we might want to use a regular file as the destination. The completers could take a com.mucommander.file.filter.FileFilter in the constructor ; the AttributeFileFilter class could then be used to retain only browsable files in the location field completer.
Feel free to send me any update as a patch and I'll promptly integrate them.
That's about it for now, thank you once again for this great feature, it rocks!
- Unnecessary horizontal scrollbar under OS X
- autocomplete_suggestions_horizontal_sb.jpg (52.88 KiB) Viewed 2727 times