当前位置: 首页>>代码示例>>Java>>正文


Java ShowDiffContext类代码示例

本文整理汇总了Java中com.intellij.openapi.vcs.changes.actions.diff.ShowDiffContext的典型用法代码示例。如果您正苦于以下问题:Java ShowDiffContext类的具体用法?Java ShowDiffContext怎么用?Java ShowDiffContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ShowDiffContext类属于com.intellij.openapi.vcs.changes.actions.diff包,在下文中一共展示了ShowDiffContext类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showDiffForChanges

import com.intellij.openapi.vcs.changes.actions.diff.ShowDiffContext; //导入依赖的package包/类
protected void showDiffForChanges(Change[] changesArray, final int indexInSelection) {
  final ShowDiffContext context = new ShowDiffContext(isInFrame() ? DiffDialogHints.FRAME : DiffDialogHints.MODAL);

  if (myAdditionalDiffActions == null) {
    context.addActions(createDiffActions());
  } else {
    context.addActions(myAdditionalDiffActions);
  }

  if (myDiffBottomComponent != null) {
    context.putChainContext(DiffUserDataKeysEx.BOTTOM_PANEL, myDiffBottomComponent);
  }

  updateDiffContext(context);

  ShowDiffAction.showDiffForChange(myProject, Arrays.asList(changesArray), indexInSelection, context);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ChangesBrowser.java

示例2: doPerform

import com.intellij.openapi.vcs.changes.actions.diff.ShowDiffContext; //导入依赖的package包/类
@Override
protected void doPerform(DirectoryHistoryDialogModel model, List<DirectoryChange> selected) {
  final Set<DirectoryChange> selectedSet = new THashSet<DirectoryChange>(selected);

  int index = 0;
  List<Change> changes = new ArrayList<Change>();
  for (DirectoryChange change : iterFileChanges()) {
    if (selectedSet.contains(change)) index = changes.size();
    changes.add(change);
  }

  ShowDiffAction.showDiffForChange(myProject, changes, index, new ShowDiffContext(DiffDialogHints.FRAME));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:DirectoryHistoryDialog.java

示例3: doPerform

import com.intellij.openapi.vcs.changes.actions.diff.ShowDiffContext; //导入依赖的package包/类
@Override
protected void doPerform(DirectoryHistoryDialogModel model, List<DirectoryChange> selected) {
  final Set<DirectoryChange> selectedSet = new THashSet<>(selected);

  int index = 0;
  List<Change> changes = new ArrayList<>();
  for (DirectoryChange change : iterFileChanges()) {
    if (selectedSet.contains(change)) index = changes.size();
    changes.add(change);
  }

  ShowDiffAction.showDiffForChange(myProject, changes, index, new ShowDiffContext(DiffDialogHints.FRAME));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:14,代码来源:DirectoryHistoryDialog.java

示例4: showDiffForChanges

import com.intellij.openapi.vcs.changes.actions.diff.ShowDiffContext; //导入依赖的package包/类
protected void showDiffForChanges(Change[] changesArray, final int indexInSelection) {
  final ShowDiffContext context = new ShowDiffContext(isInFrame() ? DiffDialogHints.FRAME : DiffDialogHints.MODAL);

  context.addActions(createDiffActions());
  if (myDiffBottomComponent != null) {
    context.putChainContext(DiffUserDataKeysEx.BOTTOM_PANEL, myDiffBottomComponent);
  }

  updateDiffContext(context);

  ShowDiffAction.showDiffForChange(myProject, Arrays.asList(changesArray), indexInSelection, context);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:13,代码来源:ChangesBrowserBase.java

示例5: showDiffFor

import com.intellij.openapi.vcs.changes.actions.diff.ShowDiffContext; //导入依赖的package包/类
@RequiredDispatchThread
public static void showDiffFor(@Nonnull Project project,
                               @Nonnull final Collection<Change> changes,
                               @Nonnull final String revNumTitle1,
                               @Nonnull final String revNumTitle2,
                               @Nonnull final FilePath filePath) {
  if (filePath.isDirectory()) {
    showChangesDialog(project, getDialogTitle(filePath, revNumTitle1, revNumTitle2), ContainerUtil.newArrayList(changes));
  }
  else {
    if (changes.isEmpty()) {
      DiffManager.getInstance().showDiff(project, new MessageDiffRequest("No Changes Found"));
    }
    else {
      final HashMap<Key, Object> revTitlesMap = new HashMap<>(2);
      revTitlesMap.put(VCS_DIFF_LEFT_CONTENT_TITLE, revNumTitle1);
      revTitlesMap.put(VCS_DIFF_RIGHT_CONTENT_TITLE, revNumTitle2);
      ShowDiffContext showDiffContext = new ShowDiffContext() {
        @Nonnull
        @Override
        public Map<Key, Object> getChangeContext(@Nonnull Change change) {
          return revTitlesMap;
        }
      };
      ShowDiffAction.showDiffForChange(project, changes, 0, showDiffContext);
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:29,代码来源:VcsDiffUtil.java

示例6: actionPerformed

import com.intellij.openapi.vcs.changes.actions.diff.ShowDiffContext; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  final int actualNumber = currentLine;
  if (actualNumber < 0) return;

  final VcsRevisionNumber revisionNumber = myFileAnnotation.getLineRevisionNumber(actualNumber);
  if (revisionNumber != null) {
    final VcsException[] exc = new VcsException[1];
    final List<Change> changes = new LinkedList<Change>();
    final FilePath[] targetPath = new FilePath[1];
    ProgressManager.getInstance().run(new Task.Backgroundable(myVcs.getProject(),
                                                              "Loading revision " + revisionNumber.asString() + " contents", true,
                                                              BackgroundFromStartOption.getInstance()) {
      @Override
      public void run(@NotNull ProgressIndicator indicator) {
        final CommittedChangesProvider provider = myVcs.getCommittedChangesProvider();
        try {
          final Pair<CommittedChangeList, FilePath> pair = provider.getOneList(myFile, revisionNumber);
          if (pair == null || pair.getFirst() == null) {
            VcsBalloonProblemNotifier.showOverChangesView(myVcs.getProject(), "Can not load data for show diff", MessageType.ERROR);
            return;
          }
          targetPath[0] = pair.getSecond() == null ? VcsUtil.getFilePath(myFile) : pair.getSecond();
          final CommittedChangeList cl = pair.getFirst();
          changes.addAll(cl.getChanges());
          Collections.sort(changes, ChangesComparator.getInstance(true));
        }
        catch (VcsException e1) {
          exc[0] = e1;
        }
      }

      @Override
      public void onSuccess() {
        if (exc[0] != null) {
          VcsBalloonProblemNotifier
            .showOverChangesView(myVcs.getProject(), "Can not show diff: " + exc[0].getMessage(), MessageType.ERROR);
        }
        else if (!changes.isEmpty()) {
          int idx = findSelfInList(changes, targetPath[0]);
          final ShowDiffContext context = new ShowDiffContext(DiffDialogHints.FRAME);
          if (idx != -1) {
            context.putChangeContext(changes.get(idx), DiffUserDataKeysEx.NAVIGATION_CONTEXT, createDiffNavigationContext(actualNumber));
          }
          if (ChangeListManager.getInstance(myVcs.getProject()).isFreezedWithNotification(null)) return;
          ShowDiffAction.showDiffForChange(myVcs.getProject(), changes, idx, context);
        }
      }
    });
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:52,代码来源:ShowDiffFromAnnotation.java

示例7: updateDiffContext

import com.intellij.openapi.vcs.changes.actions.diff.ShowDiffContext; //导入依赖的package包/类
protected void updateDiffContext(@NotNull ShowDiffContext context) {
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:3,代码来源:ChangesBrowser.java

示例8: updateDiffContext

import com.intellij.openapi.vcs.changes.actions.diff.ShowDiffContext; //导入依赖的package包/类
@Override
protected void updateDiffContext(@NotNull ShowDiffContext context) {
  context.putChainContext(CrucibleUserDataKeys.REVIEW, myReview);
}
 
开发者ID:ktisha,项目名称:Crucible4IDEA,代码行数:5,代码来源:DetailsPanel.java

示例9: actionPerformed

import com.intellij.openapi.vcs.changes.actions.diff.ShowDiffContext; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  final int actualNumber = currentLine;
  if (actualNumber < 0) return;

  final VcsRevisionNumber revisionNumber = myFileAnnotation.getLineRevisionNumber(actualNumber);
  if (revisionNumber != null) {
    final VcsException[] exc = new VcsException[1];
    final List<Change> changes = new LinkedList<Change>();
    final FilePath[] targetPath = new FilePath[1];
    ProgressManager.getInstance().run(new Task.Backgroundable(myVcs.getProject(),
                                                              "Loading revision " + revisionNumber.asString() + " contents", true,
                                                              BackgroundFromStartOption.getInstance()) {
      @Override
      public void run(@Nonnull ProgressIndicator indicator) {
        final CommittedChangesProvider provider = myVcs.getCommittedChangesProvider();
        try {
          final Pair<CommittedChangeList, FilePath> pair = provider.getOneList(myFile, revisionNumber);
          if (pair == null || pair.getFirst() == null) {
            VcsBalloonProblemNotifier.showOverChangesView(myVcs.getProject(), "Can not load data for show diff", MessageType.ERROR);
            return;
          }
          targetPath[0] = pair.getSecond() == null ? VcsUtil.getFilePath(myFile) : pair.getSecond();
          final CommittedChangeList cl = pair.getFirst();
          changes.addAll(cl.getChanges());
          Collections.sort(changes, ChangesComparator.getInstance(true));
        }
        catch (VcsException e1) {
          exc[0] = e1;
        }
      }

      @Override
      public void onSuccess() {
        if (exc[0] != null) {
          VcsBalloonProblemNotifier
                  .showOverChangesView(myVcs.getProject(), "Can not show diff: " + exc[0].getMessage(), MessageType.ERROR);
        }
        else if (!changes.isEmpty()) {
          int idx = findSelfInList(changes, targetPath[0]);
          final ShowDiffContext context = new ShowDiffContext(DiffDialogHints.FRAME);
          if (idx != -1) {
            context.putChangeContext(changes.get(idx), DiffUserDataKeysEx.NAVIGATION_CONTEXT, createDiffNavigationContext(actualNumber));
          }
          if (ChangeListManager.getInstance(myVcs.getProject()).isFreezedWithNotification(null)) return;
          ShowDiffAction.showDiffForChange(myVcs.getProject(), changes, idx, context);
        }
      }
    });
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:52,代码来源:ShowDiffFromAnnotation.java

示例10: updateDiffContext

import com.intellij.openapi.vcs.changes.actions.diff.ShowDiffContext; //导入依赖的package包/类
protected void updateDiffContext(@Nonnull ShowDiffContext context) {
}
 
开发者ID:consulo,项目名称:consulo,代码行数:3,代码来源:ChangesBrowserBase.java


注:本文中的com.intellij.openapi.vcs.changes.actions.diff.ShowDiffContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。