1 package org.jetbrains.idea.svn.difftool;
3 import com.intellij.openapi.progress.ProcessCanceledException;
4 import com.intellij.openapi.progress.ProgressIndicator;
5 import com.intellij.openapi.project.Project;
6 import com.intellij.openapi.util.UserDataHolder;
7 import com.intellij.diff.DiffContext;
8 import com.intellij.diff.FrameDiffTool;
9 import com.intellij.diff.chains.DiffRequestProducerException;
10 import com.intellij.diff.requests.DiffRequest;
11 import com.intellij.openapi.vcs.changes.Change;
12 import com.intellij.openapi.vcs.changes.actions.diff.ChangeDiffRequestProducer;
13 import com.intellij.openapi.vcs.changes.actions.diff.ChangeDiffRequestProvider;
14 import com.intellij.util.ThreeState;
15 import com.intellij.vcsUtil.UIVcsUtil;
16 import org.jetbrains.annotations.NotNull;
17 import org.jetbrains.annotations.Nullable;
21 public class SvnPhantomChangeDiffRequestProvider implements ChangeDiffRequestProvider {
24 public ThreeState isEquals(@NotNull Change change1, @NotNull Change change2) {
25 return ThreeState.UNSURE;
29 public boolean canCreate(@Nullable Project project, @NotNull Change change) {
30 return change.isPhantom();
35 public DiffRequest process(@NotNull ChangeDiffRequestProducer presentable,
36 @NotNull UserDataHolder context,
37 @NotNull ProgressIndicator indicator) throws DiffRequestProducerException, ProcessCanceledException {
38 indicator.checkCanceled();
39 return new SvnPhantomDiffRequest(presentable.getChange());
42 public static class SvnPhantomDiffRequest extends DiffRequest {
43 @NotNull private final Change myChange;
45 public SvnPhantomDiffRequest(@NotNull Change change) {
51 public String getTitle() {
52 return ChangeDiffRequestProducer.getRequestTitle(myChange);
56 public static class SvnPhantomDiffTool implements FrameDiffTool {
59 public String getName() {
60 return "SVN phantom changes viewer";
64 public boolean canShow(@NotNull DiffContext context, @NotNull DiffRequest request) {
65 return request instanceof SvnPhantomDiffRequest;
70 public DiffViewer createComponent(@NotNull DiffContext context, @NotNull DiffRequest request) {
71 return new DiffViewer() {
74 public JComponent getComponent() {
75 return UIVcsUtil.infoPanel("Technical record",
76 "This change is recorded because its target file was deleted,\nand some parent directory was copied (or moved) into the new place.");
81 public JComponent getPreferredFocusedComponent() {
87 public ToolbarComponents init() {
88 return new ToolbarComponents();
92 public void dispose() {