コード例 #1
0
 private void fireCurrentItemChanged(
     @Nullable LookupElement oldItem, @Nullable LookupElement currentItem) {
   if (oldItem != currentItem && !myListeners.isEmpty()) {
     LookupEvent event = new LookupEvent(this, currentItem, (char) 0);
     for (LookupListener listener : myListeners) {
       listener.currentItemChanged(event);
     }
   }
 }
コード例 #2
0
 private void fireLookupCanceled(final boolean explicitly) {
   if (!myListeners.isEmpty()) {
     LookupEvent event = new LookupEvent(this, explicitly);
     for (LookupListener listener : myListeners) {
       try {
         listener.lookupCanceled(event);
       } catch (Throwable e) {
         LOG.error(e);
       }
     }
   }
 }
コード例 #3
0
  public void fireItemSelected(@Nullable final LookupElement item, char completionChar) {
    PsiDocumentManager.getInstance(myProject).commitAllDocuments();

    if (!myListeners.isEmpty()) {
      LookupEvent event = new LookupEvent(this, item, completionChar);
      for (LookupListener listener : myListeners) {
        try {
          listener.itemSelected(event);
        } catch (Throwable e) {
          LOG.error(e);
        }
      }
    }
  }