Patch for auto-completion feature

8 views
Skip to first unread message

Arik

unread,
Jun 21, 2008, 3:37:41 AM6/21/08
to mucommander-dev
Hey All,

I've created a new patch of the auto-completion feature, which
includes the following changes:
1. The auto-completion location field suggests only browsable files.
2. Change the mechanism of the completers, each type of completion
became a service that the completers can use - it's more readable and
flexible that way and it reduce code repetition. It also changed the
previous not pretty usage (as Maxence declared it) of the functions
BookmarkManager#getSortedBookmarksNames() and
RootFolders#getSortedRootFoldersNames() :)
3. added AutocompletedEditableCombobox to com.mucommander.ui.combobox,
to provide a simple way to supply auto-completion capabilities to
editable-combobox (you can see the usage of this at the location-
combobox).
4. pressing cntrl+space shows the auto-completion's popup also for
text fields (in addition to down-arrow).
5. added auto-completion for system variables to location field.
6. added auto-completion capabilities to the ShellComboBox.
7. bug fixed:
bug's scenario:
- open auto-completion's popup for a certain directory you're in.
- press escape twice to hide the popup and return to the file table of
the above directory.
- delete sub-directory from the above directory.
- open the auto-completion popup again as before.
- the deleted directory will still be displayed in the popup (and will
rise a "not exist error" if selected).
solution:
The caching of directories at file paths completer was corrected - if
the cached directory was changed, the suggestions for completion are
re-examined.
8. bug fixed:
bug's scenario:
- create bookmark with the name "abc\def".
- in the location field, type "abc\d" (while you're in a directory
that doesn't contain a file named "abc").
- the auto-completion popup won't be displayed.
solution:
solved with change number 2 (the completion services addition).
9. bug fixed:
bug's scenario (under windows xp):
- type "C" (upper case) in the location field.
- the auto-completion popup with suggestion for drive "C:" won't
appear.
solution:
this bug occurred because the input was typed as upper-case.
PrefixFilter was corrected - the prefix is also converted to lower-
case (as the input of "accept" function).

I've uploaded the patch to the "files" section- its name is
"autocomplete4.patch".
(Maxence - I've created this patch with the command "svn diff >
autocomplete4.patch" under the "com" package - the patch includes new
added files and should remove some files under the
"com.mucommander.ui.autocomplete.*" which are unnecessary anymore.
when I applied the patch, it didn't remove the unnecessary files -
tell me if you'll need a list of these files).

Arik

Maxence Bernard

unread,
Jun 30, 2008, 9:36:57 AM6/30/08
to mucomma...@googlegroups.com
Hi Arik, hey all,
Sorry for the long delay in getting back to you, hell of a way to
start this group :P

Thanks a lot for this new version and the detailed change log. I've
integrated your patch, it's in the latest nightly build. The patch
didn't remove any class so I've manually removed the classes that
weren't used.
=> can you please double check that I didn't miss any or on the
contrary that I didn't remove too many of them?

I played with the improvements you described and they're all great
additions. The autocomplete package is also a whole lot easier to
understand now.

One thing that I noticed under Mac OS X is that the UP/DOWN arrow keys
don't trigger the completion popup when pressed in the location bar or
shell combo box. They work OK though in simple text fields, for
example in the Copy dialog. The combo box component probably consumes
those key events before they reach the completion code. I don't know
if that is specific to Mac OS X, please let me know if you want me to
take a shot at this.

Thanks again for the great additions!
Cheers,
Maxence

Arik

unread,
Jul 1, 2008, 4:18:30 PM7/1/08
to mucommander-dev
Hey Maxence,

> One thing that I noticed under Mac OS X is that the UP/DOWN arrow keys  
> don't trigger the completion popup when pressed in the location bar or  
> shell combo box. They work OK though in simple text fields, for  
> example in the Copy dialog. The combo box component probably consumes  
> those key events before they reach the completion code. I don't know  
> if that is specific to Mac OS X, please let me know if you want me to  
> take a shot at this.

This is also the case under Windows, I did it on purpose - originally
I planned that the completion popup will be triggered by:
down key for text fields.
cntrl + space for EditableComboBox because the down key was already
used to expand the combo-box's popup.

I found it a little confusing that way so at the latest patch I've
added the cntrl+space combination also for text fields (in addition to
the down key).
The down key functionality was not added to EditableComboBox because I
wanted to preserve it for expanding the combo-box's popup menu without
the interfering of completion popup.

Arik

unread,
Jul 1, 2008, 5:02:51 PM7/1/08
to mucommander-dev

Maxence, I can't checkout the project in the last 2 dayes - I'm using
TortoiseSVN version 1.5.0 and it raise an error after download some of
the "build" directory (the content of "tools" and "conf" directories)
- I selected the option to send a report of this crush, but can you
please also check to see if you have any clue why this problem occur?

Thanks.

Maxence Bernard

unread,
Jul 2, 2008, 5:18:31 AM7/2/08
to mucomma...@googlegroups.com
Hi Arik,
This makes sense, thanks for the explanation !

Maxence

Maxence Bernard

unread,
Jul 2, 2008, 5:33:39 AM7/2/08
to mucomma...@googlegroups.com
Hi again Arik,

I just checked out the project using the svn command line client
without any problem. I've also installed TortoiseSVN 1.5.0 on Windows
XP and checked out the project also without any problem : I just had
to click 'SVN checkout' in the Explorer right-click menu and enter the
URL (https://svn.mucommander.com/mucommander/trunk mucommander).

Is there a specific error message that would give more information as
to what the problem is ?

Maxence

Arik

unread,
Jul 5, 2008, 11:47:51 AM7/5/08
to mucommander-dev
Hey,

I did the chekcout as you write - It worked fine until last week but
since then it doesn't work in my PC, in my laptop and in another PC
that I checked - maybe it's related to the service pack 3 - they all
contain it, and it was the only change I did since the last time the
checkout worked.

I installed ubuntu along with my windows xp (I was planning to install
it for some time and now this subversion thing gave me another reason
to do it..) and there it work - so I'll work from there.

Thanks,

Arik

Maxence Bernard

unread,
Jul 7, 2008, 3:53:06 AM7/7/08
to mucomma...@googlegroups.com
Hi Arik,
Indeed, I don't have SP3 installed on my Windows XP (virtual) machine
so SP3 may be the cause of the problem.
If you haven't done so already, you could give some other clients a
try (cygwin svn in particular), maybe they're not affected.

That being said, the switch to Ubuntu is probably a good move anyway ;)

Cheers,
Maxence

Reply all
Reply to author
Forward
0 new messages