本文整理汇总了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);
}
示例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));
}
示例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));
}
示例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);
}
示例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);
}
}
}
示例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);
}
}
});
}
}
示例7: updateDiffContext
import com.intellij.openapi.vcs.changes.actions.diff.ShowDiffContext; //导入依赖的package包/类
protected void updateDiffContext(@NotNull ShowDiffContext context) {
}
示例8: updateDiffContext
import com.intellij.openapi.vcs.changes.actions.diff.ShowDiffContext; //导入依赖的package包/类
@Override
protected void updateDiffContext(@NotNull ShowDiffContext context) {
context.putChainContext(CrucibleUserDataKeys.REVIEW, myReview);
}
示例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);
}
}
});
}
}
示例10: updateDiffContext
import com.intellij.openapi.vcs.changes.actions.diff.ShowDiffContext; //导入依赖的package包/类
protected void updateDiffContext(@Nonnull ShowDiffContext context) {
}