コード例 #1
0
  private boolean updateLookup() {
    ApplicationManager.getApplication().assertIsDispatchThread();
    if (isOutdated()) return false;

    boolean justShown = false;
    if (!myLookup.isShown() && shouldShowLookup()) {
      if (hideAutopopupIfMeaningless()) {
        return false;
      }

      if (StringUtil.isEmpty(myLookup.getAdvertisementText()) && !isAutopopupCompletion()) {
        final String text = DefaultCompletionContributor.getDefaultAdvertisementText(myParameters);
        if (text != null) {
          myLookup.setAdvertisementText(text);
        }
      }

      if (!myLookup.showLookup()) {
        return false;
      }
      justShown = true;
    }
    myLookup.refreshUi(true);
    hideAutopopupIfMeaningless();
    if (justShown) {
      myLookup.ensureSelectionVisible();
    }
    return true;
  }
コード例 #2
0
  private boolean updateLookup() {
    ApplicationManager.getApplication().assertIsDispatchThread();
    if (isOutdated() || !shouldShowLookup()) return false;

    boolean justShown = false;
    if (!myLookup.isShown()) {
      if (hideAutopopupIfMeaningless()) {
        return false;
      }

      if (Registry.is("dump.threads.on.empty.lookup")
          && myLookup.isCalculating()
          && myLookup.getItems().isEmpty()) {
        PerformanceWatcher.getInstance().dumpThreads(true);
      }

      if (StringUtil.isEmpty(myLookup.getAdvertisementText()) && !isAutopopupCompletion()) {
        final String text = DefaultCompletionContributor.getDefaultAdvertisementText(myParameters);
        if (text != null) {
          myLookup.setAdvertisementText(text);
        }
      }

      if (!myLookup.showLookup()) {
        return false;
      }
      justShown = true;
    }
    myLookup.refreshUi(true, justShown);
    hideAutopopupIfMeaningless();
    if (justShown) {
      myLookup.ensureSelectionVisible();
    }
    return true;
  }