Examples of withInsertHandler()


Examples of com.intellij.codeInsight.lookup.LookupElementBuilder.withInsertHandler()

      builder = builder.withTailText(info.getLibraryId(), true);
    }
    if (info.getType() != null) {
      builder = builder.withIcon(info.getType().getIcon());
    }
    return builder.withInsertHandler(MY_INSERT_HANDLER);
  }

  private static final InsertHandler<LookupElement> MY_INSERT_HANDLER = new InsertHandler<LookupElement>() {
    @Override
    public void handleInsert(InsertionContext context, LookupElement item) {
View Full Code Here

Examples of com.intellij.codeInsight.lookup.LookupElementBuilder.withInsertHandler()

        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)));
      }
    }
  }

  private static class StepInsertHandler implements InsertHandler<LookupElement> {
View Full Code Here

Examples of com.intellij.codeInsight.lookup.LookupElementBuilder.withInsertHandler()

    if (!braces) {
      return keyword.startsWith("%") ? TailTypeDecorator.withTail(builder, TailType.SPACE) : builder;
    }
    else {
      final String closing = keyword.endsWith("{") ? keyword.substring(0, keyword.length()-1) + "}" : null;
      return PrioritizedLookupElement.withPriority(builder.withInsertHandler(new InsertHandler<LookupElement>() {
        @Override
        public void handleInsert(InsertionContext context, LookupElement item) {
          int caret = context.getTailOffset();
          Document document = context.getDocument();
          StringBuilder sb = new StringBuilder("\n");
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.