/** * Adds a single completion to this provider. If you are adding multiple * completions to this provider, for efficiency reasons please consider * using {@link #addCompletions(List)} instead. * * @param c The completion to add. * @throws IllegalArgumentException If the completion's provider isn't * this <tt>CompletionProvider</tt>. * @see #addCompletions(List) * @see #removeCompletion(Completion) * @see #clear() */ public void addCompletion(Completion c) { checkProviderAndAdd(c); Collections.sort(completions); }
/** * Constructor. */ public AbstractCompletionProvider() { comparator = new CaseInsensitiveComparator(); clearParameterizedCompletionParams(); completions = new ArrayList<Completion>(); }
private void setCommentCompletions(ShorthandCompletionCache shorthandCache) { AbstractCompletionProvider provider = shorthandCache.getCommentProvider(); if(provider != null) { for (Completion c : shorthandCache.getCommentCompletions()) { provider.addCompletion(c); } setCommentCompletionProvider(provider); } }
String text = getAlreadyEnteredText(comp);
String name = e.getDescription(); List<Completion> l = ((AbstractCompletionProvider)p). getCompletionByInputText(name); if (l!=null && !l.isEmpty()) {
/** * load the comment completions from the short hand cache * @param shorthandCache */ private void setCommentCompletions(ShorthandCompletionCache shorthandCache){ AbstractCompletionProvider provider = shorthandCache.getCommentProvider(); if(provider != null) { for (Completion c : shorthandCache.getCommentCompletions()) { provider.addCompletion(c); } setCommentCompletionProvider(provider); } }
/** * Adds {@link Completion}s to this provider. * * @param completions The completions to add. This cannot be * <code>null</code>. * @throws IllegalArgumentException If a completion's provider isn't * this <tt>CompletionProvider</tt>. * @see #addCompletion(Completion) * @see #removeCompletion(Completion) * @see #clear() */ public void addCompletions(List<Completion> completions) { //this.completions.addAll(completions); for (Completion c : completions) { checkProviderAndAdd(c); } Collections.sort(this.completions); }