Changeset 13173 in josm for trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionList.java
- Timestamp:
- 2017-11-28T00:56:29+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionList.java
r12859 r13173 5 5 import java.util.Collection; 6 6 import java.util.Collections; 7 import java.util.List;8 7 import java.util.Set; 9 import java.util.stream.Collectors;10 8 11 9 import javax.swing.JTable; … … 51 49 52 50 /** 53 * applies a filter expression to the list of {@link AutoCompletion ListItem}s.51 * applies a filter expression to the list of {@link AutoCompletionItem}s. 54 52 * 55 53 * The matching criterion is a case insensitive substring match. … … 81 79 82 80 /** 83 * adds an {@link AutoCompletionListItem} to the list. Only adds the item if it84 * is not null and if not in the list yet.85 *86 * @param item the item87 * @deprecated To be removed end of 2017. Use {@link #add(AutoCompletionItem)} instead88 */89 @Deprecated90 public void add(AutoCompletionListItem item) {91 if (item == null)92 return;93 add(item.getItem());94 }95 96 /**97 81 * adds an {@link AutoCompletionItem} to the list. Only adds the item if it 98 82 * is not null and if not in the list yet. … … 135 119 136 120 /** 137 * adds a list of {@link AutoCompletionListItem} to this list. Only items which138 * are not null and which do not exist yet in the list are added.139 *140 * @param other a list of AutoCompletionListItem; must not be null141 * @throws IllegalArgumentException if other is null142 * @deprecated to be removed end of 2017. Use {@link #add(Collection)} instead143 */144 @Deprecated145 public void add(List<AutoCompletionListItem> other) {146 CheckParameterUtil.ensureParameterNotNull(other, "other");147 add(other.stream().map(AutoCompletionListItem::getItem).collect(Collectors.toList()));148 }149 150 /**151 121 * adds a list of strings to this list. Only strings which 152 122 * are not null and which do not exist yet in the list are added. … … 154 124 * @param values a list of strings to add 155 125 * @param priority the priority to use 156 * @deprecated to be removed end of 2017. Use {@link #add(Collection, AutoCompletionPriority)} instead157 */158 @Deprecated159 public void add(Collection<String> values, AutoCompletionItemPriority priority) {160 add(values, priority.getPriority());161 }162 163 /**164 * adds a list of strings to this list. Only strings which165 * are not null and which do not exist yet in the list are added.166 *167 * @param values a list of strings to add168 * @param priority the priority to use169 126 * @since 12859 170 127 */ … … 183 140 filter(); 184 141 } 185 }186 187 /**188 * checks whether a specific item is already in the list. Matches for the189 * the value <strong>and</strong> the priority of the item190 *191 * @param item the item to check192 * @return true, if item is in the list; false, otherwise193 * @deprecated to be removed end of 2017. Use {@link #contains(AutoCompletionItem)} instead194 */195 @Deprecated196 public boolean contains(AutoCompletionListItem item) {197 if (item == null)198 return false;199 return contains(item.getItem());200 142 } 201 143 … … 264 206 * 265 207 * @throws IndexOutOfBoundsException if idx is out of bounds 266 * @deprecated to be removed end of 2017. Use {@link #getFilteredItemAt(int)} instead267 */268 @Deprecated269 public AutoCompletionListItem getFilteredItem(int idx) {270 return new AutoCompletionListItem(getFilteredItemAt(idx));271 }272 273 /**274 * replies the idx-th item from the list of filtered items275 * @param idx the index; must be in the range 0 <= idx < {@link #getFilteredSize()}276 * @return the item277 *278 * @throws IndexOutOfBoundsException if idx is out of bounds279 208 * @since 12859 280 209 */
Note:
See TracChangeset
for help on using the changeset viewer.