Diff architecture usage

Hi,

I am writing a VCS plugin in which I want to use the Diff window of
IntelliJ.
I have implemented DiffProvider interface, and extended VcsRevisionNumber
class. I have also overridden getDiffProvider method in a class which
extends AbstractVcs.
But I am not exactly sure how this whole architecture works and also if l I
add a compare action, how will it by default call the DiffProvider.

Any pointers in this respect would be of great help.

~Priya


1 comment
Comment actions Permalink

Hello,

I am trying to fix an AccuRev plugin and I am having a problem
Although I see that IDEA can identify code changes (tab colors, side colors
in changed lines etc.), I always get false in hasDiff() method of
CheckinProjectDialogImplementer
In the code below, I always get into the if statement, and when I tried
knocking it down and show the dialog (d.show()) I get a dialog with no
files in it
What am I doing something wrong OR is it a bug?

code:
public class CheckinProjectHandler {
private Module myModule;
private Project myProject;

public CheckinProjectHandler(Module module, Project project) {
myModule = module;
myProject = project;
}

public void execute() {
((com.intellij.openapi.fileEditor.FileDocumentManager)
com.intellij.openapi.fileEditor.FileDocumentManager.getInstance()).saveAllDocuments();
ModuleLevelVcsManager instance =
ModuleLevelVcsManager.getInstance(myModule);

final CheckinProjectDialogImplementer d =
instance.createCheckinProjectDialog(instance.getActiveVcs().getCheckinEnvironment());
final AbstractVcsHelper vcsHelper = ((AbstractVcsHelper)
AbstractVcsHelper.getInstance(myProject));
try {
d.analyzeChanges(true, null);
} catch (VcsException e) {
e.printStackTrace(); //To change body of catch statement
use File | Settings | File Templates.
}

if (!d.hasDiffs()) {
d.dispose();
return;
}

d.show();

.....

Thank you,
Ilan
P.S.
IDEA 5.x API is very poorly documented.

0

Please sign in to leave a comment.