Examples of LookupElementBuilder


Examples of com.intellij.codeInsight.lookup.LookupElementBuilder

    CamelHumpMatcher matcher = new CamelHumpMatcher(prefix, false);

    CompletionResultSet result2 = result.withPrefixMatcher(matcher);
    for (String name : symbols.keySet()) {
      SymbolInformationProvider.SymbolInformation symbol = symbols.get(name);
      LookupElementBuilder elm = LookupElementBuilder
          .create(name)
          .withInsertHandler(MathematicaBracketInsertHandler.getInstance())
          .withTypeText(symbol.context + "`")
          .withPresentableText(symbol.nameWithoutContext);
      result2.addElement(PrioritizedLookupElement.withPriority(elm, symbol.importance));
View Full Code Here

Examples of com.intellij.codeInsight.lookup.LookupElementBuilder

    public Object[] getVariants() {
        List<LookupElement> lookupElements = new ArrayList<LookupElement>();

        for(Field field: this.phpClass.getFields()) {
            if(!field.isConstant()) {
                LookupElementBuilder lookupElement = LookupElementBuilder.createWithIcon(field);
                lookupElement = attachLookupInformation(field, lookupElement);
                lookupElements.add(lookupElement);
            }
        }
View Full Code Here

Examples of com.intellij.codeInsight.lookup.LookupElementBuilder

        PropertiesFile properties = PropertiesIndex.getBaseFile(c);
        if (properties != null) {
            for (IProperty property : properties.getProperties()) {
                String propertyKey = property.getKey();
                if (propertyKey != null) {
                    LookupElementBuilder lookupElementBuilder =
                            LookupElementBuilder.create(propertyKey)
                                    .withIcon(StdFileTypes.PROPERTIES.getIcon())
                                    .withTypeText(".properties")
                                    .withTailText("  " + property.getValue(), true);
                    rs.addElement(lookupElementBuilder);
View Full Code Here

Examples of com.intellij.codeInsight.lookup.LookupElementBuilder

    );
  }

  @NotNull
  private static LookupElement buildElement(String componentName, DartComponentInfo info) {
    LookupElementBuilder builder = LookupElementBuilder.create(info, componentName);
    if (info.getLibraryId() != null) {
      builder = builder.withTailText(info.getLibraryId(), true);
    }
    if (info.getType() != null) {
      builder = builder.withIcon(info.getType().getIcon());
    }
    return builder.withInsertHandler(MY_INSERT_HANDLER);
  }
View Full Code Here

Examples of com.intellij.codeInsight.lookup.LookupElementBuilder

        final PsiFile psiFile = xmlElement.getContainingFile();

        if (psiFile != null &&
            StringUtil.isNotEmpty(definitionName)) {
          //noinspection ConstantConditions
          final LookupElementBuilder builder =
            LookupElementBuilder.create(definition, definitionName)
              .withIcon(StrutsApiIcons.Tiles.Tile)
              .withTypeText(psiFile.getName());
          variants.add(builder);
        }
View Full Code Here

Examples of com.intellij.codeInsight.lookup.LookupElementBuilder

        while (m.find()) {
          ranges.add(new TextRange(m.start(), m.end()));
        }

        final PsiElement element = definition.getElement();
        final LookupElementBuilder lookup = element != null
                                            ? LookupElementBuilder.create(element, text).bold()
                                            : LookupElementBuilder.create(text);
        result.addElement(lookup.withInsertHandler(new StepInsertHandler(ranges)));
      }
    }
  }
View Full Code Here

Examples of com.intellij.codeInsight.lookup.LookupElementBuilder

      final PsiMethod psiMethod = entry.getValue();
      final PsiType propertyType = PropertyUtil.getPropertyType(psiMethod);
      assert propertyType != null;

      final LookupElementBuilder variant =
        LookupElementBuilder.create(psiMethod, propertyName)
          .withIcon(psiMethod.getIcon(0))
          .withStrikeoutness(psiMethod.isDeprecated())
          .withTypeText(propertyType.getPresentableText());
      variants[i++] = variant;
View Full Code Here

Examples of com.intellij.codeInsight.lookup.LookupElementBuilder

            fullPath = actionNamespace + "/" + actionPath;
          } else {
            fullPath = actionPath;
          }

          final LookupElementBuilder builder = LookupElementBuilder.create(action.getXmlTag(), fullPath)
            .withBoldness(isInCurrentPackage)
            .withIcon(Struts2Icons.Action)
            .withTypeText(action.getNamespace());
          variants.add(builder);
        }
View Full Code Here

Examples of com.intellij.codeInsight.lookup.LookupElementBuilder

            fullPath = actionNamespace + "/" + actionPath + firstExtension;
          } else {
            fullPath = actionPath + firstExtension;
          }

          final LookupElementBuilder builder = LookupElementBuilder.create(action.getXmlTag(), fullPath)
                                                                   .withBoldness(isInCurrentPackage)
                                                                   .withIcon(Struts2Icons.Action)
                                                                   .withTypeText(action.getNamespace());
          variants.add(builder);
        }
View Full Code Here

Examples of com.intellij.codeInsight.lookup.LookupElementBuilder

             @Override
             protected void addCompletions(@NotNull final CompletionParameters completionParameters,
                                           final ProcessingContext processingContext,
                                           @NotNull final CompletionResultSet completionResultSet) {
               for (final String keyword : keywords) {
                 final LookupElementBuilder builder = LookupElementBuilder.create(keyword).bold();
                 completionResultSet.addElement(TailTypeDecorator.withTail(builder, TailType.SPACE));
               }
             }
           });
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.