Example usage for com.intellij.openapi.diff DocumentContent DocumentContent

List of usage examples for com.intellij.openapi.diff DocumentContent DocumentContent

Introduction

In this page you can find the example usage for com.intellij.openapi.diff DocumentContent DocumentContent.

Prototype

public DocumentContent(@NotNull Document document) 

Source Link

Usage

From source file:jetbrains.communicator.idea.DiffWindowOpener.java

License:Apache License

public void showDiff() {
    DiffTool diffTool = DiffManager.getInstance().getIdeaDiffTool();
    SimpleDiffRequest diffRequest = new SimpleDiffRequest(myProject, "Diff for " + myVFile.getDisplayName());
    diffRequest.addHint(DiffTool.HINT_SHOW_NOT_MODAL_DIALOG);

    Document localDocument = FileDocumentManager.getInstance().getDocument(myVirtualFile);

    diffRequest.setContentTitles("My Version", myRemoteUser.getDisplayName() + "'s Version");
    diffRequest.setContents(new DocumentContent(localDocument), new SimpleContent(myRemoteText));

    diffTool.show(diffRequest);/*  w  w w . j av  a  2 s .  co  m*/
}

From source file:org.sonar.ide.idea.actions.OpenDiffToolAction.java

License:Open Source License

private DiffRequest getDiffRequest(final Project project, Document doc1, Document doc2) {
    return new SonarDiffRequest(project, new DocumentContent(doc2), new DocumentContent(doc1));
}