private static void addSomeItems(
     LinkedHashSet<LookupElement> model,
     Iterator<LookupElement> iterator,
     Condition<LookupElement> stopWhen) {
   while (iterator.hasNext()) {
     LookupElement item = iterator.next();
     model.add(item);
     if (stopWhen.value(item)) {
       break;
     }
   }
 }
예제 #2
0
  protected void defineScopeEquivalence(Class scopeClass, Class equivClass) {
    final Iterator<CompletionVariant> iter = myCompletionVariants.iterator();
    if (isScopeFinal(scopeClass)) {
      declareFinalScope(equivClass);
    }

    while (iter.hasNext()) {
      final CompletionVariant variant = iter.next();
      if (variant.isScopeClassAcceptable(scopeClass)) {
        variant.includeScopeClass(equivClass, variant.isScopeClassFinal(scopeClass));
      }
    }
  }