コード例 #1
0
  @Override
  protected void actionPerformed(
      @NotNull AnActionEvent e,
      @NotNull Project project,
      @NotNull ChangeRequestChain chain,
      @NotNull DiffViewer diffViewer) {
    List<DiffRequestPresentable> requests = chain.getAllRequests();
    List<Change> changes = getChangesFromRequests(requests);

    ChangesBrowser cb = new MyChangesBrowser(project, changes, requests, chain, diffViewer);

    myPopup =
        JBPopupFactory.getInstance()
            .createComponentPopupBuilder(cb, cb.getPreferredFocusedComponent())
            .setResizable(true)
            .setModalContext(false)
            .setFocusable(true)
            .setRequestFocus(true)
            .setCancelOnWindowDeactivation(true)
            .setCancelOnOtherWindowOpen(true)
            .setMovable(true)
            .setCancelKeyEnabled(true)
            .setCancelOnClickOutside(true)
            .createPopup();

    InputEvent event = e.getInputEvent();
    if (event instanceof MouseEvent) {
      myPopup.show(new RelativePoint((MouseEvent) event));
    } else {
      myPopup.showInBestPositionFor(e.getDataContext());
    }
  }
コード例 #2
0
 @Override
 public void run() {
   Change change = getSelectedChanges().get(0);
   DiffRequestPresentable selectedStep = findSelectedStep(change);
   if (selectedStep != null) {
     DiffRequest newRequest = myChain.moveTo(selectedStep);
     openRequest(myDiffViewer, newRequest);
   }
   myPopup.cancel();
 }
コード例 #3
0
 @Override
 protected boolean isEnabled(@NotNull ChangeRequestChain chain) {
   return getChangesFromRequests(chain.getAllRequests()).size() > 1;
 }