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

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

Introduction

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

Prototype

public SimpleContent(String text) 

Source Link

Document

Constructs content with given text and null type

Usage

From source file:com.intellij.execution.testframework.stacktrace.DiffHyperlink.java

License:Apache License

public void openDiff(final Project project) {
    String expectedTitle = ExecutionBundle.message("diff.content.expected.title");
    final DiffContent expectedContent;
    final VirtualFile vFile;
    if (myFilePath != null && (vFile = LocalFileSystem.getInstance().findFileByPath(myFilePath)) != null) {
        expectedContent = DiffContent.fromFile(project, vFile);
        expectedTitle += " (" + vFile.getPresentableUrl() + ")";
    } else/*from w w w  .j a v a 2  s .co  m*/
        expectedContent = new SimpleContent(myExpected);
    final SimpleDiffRequest diffData = new SimpleDiffRequest(project, getTitle());
    diffData.setContents(expectedContent, new SimpleContent(myActual));
    diffData.setContentTitles(expectedTitle, ExecutionBundle.message("diff.content.actual.title"));
    diffData.addHint(DiffTool.HINT_SHOW_FRAME);
    diffData.addHint(DiffTool.HINT_DO_NOT_IGNORE_WHITESPACES);
    diffData.setGroupKey("#com.intellij.execution.junit2.states.ComparisonFailureState$DiffDialog");
    DiffManager.getInstance().getIdeaDiffTool().show(diffData);
}

From source file:com.intellij.history.integration.ui.models.FileDifferenceModel.java

License:Apache License

public DiffContent getLeftDiffContent(RevisionProcessingProgress p) {
    if (!canShowLeftEntry(p))
        return new SimpleContent("");
    return doGetLeftDiffContent(p);
}

From source file:com.intellij.history.integration.ui.models.FileDifferenceModel.java

License:Apache License

public DiffContent getRightDiffContent(RevisionProcessingProgress p) {
    if (!canShowRightEntry(p))
        return new SimpleContent("");
    if (isRightContentCurrent)
        return getEditableRightDiffContent(p);
    return getReadOnlyRightDiffContent(p);
}

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);/*from w w  w. j  ava2s .  co m*/
}

From source file:org.jetbrains.idea.svn.diff.FileWithBranchComparer.java

License:Apache License

@Override
protected void showResult() {
    if (!success.isNull()) {
        SimpleDiffRequest req = new SimpleDiffRequest(myProject,
                SvnBundle.message("compare.with.branch.diff.title"));
        req.setContents(//from  ww  w.  j  a v  a2  s.co m
                new SimpleContent(CharsetToolkit.bytesToString(content.get(), myVirtualFile.getCharset())),
                new FileContent(myProject, myVirtualFile));
        req.setContentTitles(remoteTitleBuilder.toString(), myVirtualFile.getPresentableUrl());
        DiffManager.getInstance().getDiffTool().show(req);
    }
}