Example usage for com.intellij.openapi.diff DiffTool HINT_SHOW_FRAME

List of usage examples for com.intellij.openapi.diff DiffTool HINT_SHOW_FRAME

Introduction

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

Prototype

Object HINT_SHOW_FRAME

To view the source code for com.intellij.openapi.diff DiffTool HINT_SHOW_FRAME.

Click Source Link

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 www .  j  a va 2s .  c  om
        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.urswolfer.intellij.plugin.gerrit.ui.diff.CustomizableFrameDiffTool.java

License:Apache License

static boolean shouldOpenDialog(Collection hints) {
    if (hints.contains(DiffTool.HINT_SHOW_MODAL_DIALOG))
        return true;
    if (hints.contains(DiffTool.HINT_SHOW_NOT_MODAL_DIALOG))
        return true;
    if (hints.contains(DiffTool.HINT_SHOW_FRAME))
        return false;
    return KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow() instanceof JDialog;
}