Ejemplo n.º 1
0
  private void setupListView() {
    setVgrow(listView, Priority.ALWAYS);
    setupKeyboardShortcuts();

    listView.setOnItemSelected(
        i -> {
          TurboIssue issue = listView.getItems().get(i);
          ui.triggerEvent(
              new IssueSelectedEvent(
                  issue.getRepoId(), issue.getId(), panelIndex, issue.isPullRequest()));

          // Save the stored comment count as its own comment count.
          // The refreshItems(false) call that follows will remove the highlighted effect of the
          // comment bubble.
          // (if it was there before)
          issueCommentCounts.put(issue.getId(), issue.getCommentCount());
          issueNonSelfCommentCounts.put(
              issue.getId(), issue.getMetadata().getNonSelfCommentCount());
          // We assume we already have metadata, so we pass true to avoid refreshItems from trying
          // to get
          // metadata after clicking.
          refreshItems(true);
        });
  }