public Object getData(String dataId) {
    if (myTreeBrowser != null && myTreeBrowser.isVisible()) {
      return null;
    }
    if (PlatformDataKeys.NAVIGATABLE.is(dataId)) {
      if (mySelectedFile == null || !mySelectedFile.isValid()) return null;
      return new OpenFileDescriptor(myProject, mySelectedFile);
    } else if (PlatformDataKeys.VIRTUAL_FILE_ARRAY.is(dataId)) {
      return getVirtualFileArray();
    } else if (VcsDataKeys.IO_FILE_ARRAY.is(dataId)) {
      return getFileArray();
    } else if (PlatformDataKeys.TREE_EXPANDER.is(dataId)) {
      if (myGroupByChangeList) {
        return myTreeBrowser != null ? myTreeBrowser.getTreeExpander() : null;
      } else {
        return myTreeExpander;
      }
    } else if (VcsDataKeys.UPDATE_VIEW_SELECTED_PATH.is(dataId)) {
      return mySelectedUrl;
    } else if (VcsDataKeys.UPDATE_VIEW_FILES_ITERABLE.is(dataId)) {
      return myTreeIterable;
    } else if (VcsDataKeys.LABEL_BEFORE.is(dataId)) {
      return myBefore;
    } else if (VcsDataKeys.LABEL_AFTER.is(dataId)) {
      return myAfter;
    }

    return super.getData(dataId);
  }
 @Override
 public void run(ContinuationContext context) {
   final List<Change> changesForPatch;
   try {
     final List<CommittedChangeList> lst = loadSvnChangeListsForPatch(myDescription);
     changesForPatch = CommittedChangesTreeBrowser.collectChanges(lst, true);
     for (Change change : changesForPatch) {
       if (change.getBeforeRevision() != null) {
         preloadRevisionContents(change.getBeforeRevision());
       }
       if (change.getAfterRevision() != null) {
         preloadRevisionContents(change.getAfterRevision());
       }
     }
   } catch (VcsException e) {
     context.handleException(e, true);
     return;
   }
   final List<Change> binaryChanges = filterOutBinary(changesForPatch);
   if (binaryChanges != null && !binaryChanges.isEmpty()) {
     myTheirsBinaryChanges.addAll(binaryChanges);
   }
   if (!changesForPatch.isEmpty()) {
     myTheirsChanges.addAll(changesForPatch);
   }
 }
示例#3
0
 @Nullable
 public List<Change> getSelectedChanges() {
   TableModel model = getModel();
   if (!(model instanceof AbstractVcsLogTableModel)) {
     return null;
   }
   List<Change> changes =
       ((AbstractVcsLogTableModel) model).getSelectedChanges(sortSelectedRows());
   return changes == null ? null : CommittedChangesTreeBrowser.zipChanges(changes);
 }
 protected JComponent createCenterPanel() {
   JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myTree);
   scrollPane.setBorder(IdeBorderFactory.createBorder(SideBorder.LEFT));
   myCenterPanel.add(CARD_STATUS, scrollPane);
   myTreeBrowser =
       new CommittedChangesTreeBrowser(myProject, Collections.<CommittedChangeList>emptyList());
   Disposer.register(this, myTreeBrowser);
   myTreeBrowser.setHelpId(getHelpId());
   myCenterPanel.add(CARD_CHANGES, myTreeBrowser);
   return myCenterPanel;
 }