Ignore:
Timestamp:
04.09.2009 10:49:53 (3 years ago)
Author:
Gubaer
Message:

Improved auto completion
fixed #2729: Auto completion with numbers sometimes annoying (only fixed in presets, relation editor, not in property dialog)
fixed #2320: Preset dialog for house numbers should have autocompletion (auto completion now supported in all preset dialogs)

Location:
trunk/src/org/openstreetmap/josm/gui/tagging/ac
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionList.java

    r1762 r2048  
    1 package org.openstreetmap.josm.gui.dialogs.relation.ac; 
     1package org.openstreetmap.josm.gui.tagging.ac; 
    22 
    33import java.util.ArrayList; 
     4import java.util.Collection; 
    45import java.util.Collections; 
    56import java.util.List; 
     
    125126    } 
    126127 
     128    /** 
     129     * adds a list of strings to this list. Only strings which 
     130     * are not null and which do not exist yet in the list are added. 
     131     *  
     132     * @param value a list of strings to add 
     133     * @param priority the priority to use 
     134     */ 
     135    public void add(Collection<String> values, AutoCompletionItemPritority priority) { 
     136        if (values == null) return; 
     137        for (String value: values) { 
     138            if (value == null) { 
     139                continue; 
     140            } 
     141            AutoCompletionListItem item = new AutoCompletionListItem(value,priority); 
     142            appendOrUpdatePriority(item); 
     143 
     144        } 
     145        sort(); 
     146        filter(); 
     147    } 
     148 
    127149    protected void appendOrUpdatePriority(AutoCompletionListItem toadd) { 
    128150        AutoCompletionListItem item = lookup(toadd.getValue()); 
Note: See TracChangeset for help on using the changeset viewer.