コード例 #1
0
  private void addEmptyItem(CollectionListModel<LookupElement> model) {
    LookupItem<String> item =
        new EmptyLookupItem(
            myCalculating ? " " : LangBundle.message("completion.no.suggestions"), false);
    myMatchers.put(item, new CamelHumpMatcher(""));
    model.add(item);

    updateLookupWidth(item);
    requestResize();
  }
コード例 #2
0
  public boolean addItem(LookupElement item, PrefixMatcher matcher) {
    LookupElementPresentation presentation = renderItemApproximately(item);
    if (containsDummyIdentifier(presentation.getItemText())
        || containsDummyIdentifier(presentation.getTailText())
        || containsDummyIdentifier(presentation.getTypeText())) {
      return false;
    }

    myMatchers.put(item, matcher);
    updateLookupWidth(item, presentation);
    synchronized (myList) {
      myArranger.addElement(this, item, presentation);
    }
    return true;
  }
コード例 #3
0
 public void updateLookupWidth(LookupElement item) {
   updateLookupWidth(item, renderItemApproximately(item));
 }