public abstract class DiffManager
extends java.lang.Object
showDiff(com.intellij.openapi.project.Project, com.intellij.diff.requests.DiffRequest)
/showMerge(com.intellij.openapi.project.Project, com.intellij.diff.merge.MergeRequest)
methods to show diff viewer in a frame or modal window.
Use createRequestPanel(com.intellij.openapi.project.Project, com.intellij.openapi.Disposable, java.awt.Window)
to embed diff viewer as JComponent.
For a more fine-grained control over content behavior, extend DiffRequestProcessor
directly.
Use DiffUserDataKeys
and DiffRequest.putUserData(com.intellij.openapi.util.Key<T>, T)
/UserDataHolder.putUserData(com.intellij.openapi.util.Key<T>, T)
to pass additional hints (such as default scrollbar position). Note, that these hints might be ignored.
Use DiffExtension
to customize existing diff viewers.
Register custom FrameDiffTool
to support custom DiffRequest
or to add new views for default ones.
DiffContent content1 = DiffContentFactory.getInstance().create(project, "Stuff"); DiffContent content2 = DiffContentFactory.getInstance().createClipboardContent(project); content2.putUserData(DiffUserDataKeys.FORCE_READ_ONLY, true); SimpleDiffRequest request = new SimpleDiffRequest("Stuff vs Clipboard", content1, content2, "Stuff", "Clipboard"); DiffManager.getInstance().showDiff(project, request);
Constructor and Description |
---|
DiffManager() |
Modifier and Type | Method and Description |
---|---|
abstract DiffRequestPanel |
createRequestPanel(Project project,
Disposable parent,
java.awt.Window window)
Creates simple JComponent, capable of displaying
DiffRequest . |
static DiffManager |
getInstance() |
abstract void |
showDiff(Project project,
DiffRequest request) |
abstract void |
showDiff(Project project,
DiffRequestChain requests,
DiffDialogHints hints) |
abstract void |
showDiff(Project project,
DiffRequest request,
DiffDialogHints hints) |
abstract void |
showMerge(Project project,
MergeRequest request) |
public static DiffManager getInstance()
public abstract void showDiff(Project project, DiffRequest request)
SimpleDiffRequest
public abstract void showDiff(Project project, DiffRequest request, DiffDialogHints hints)
public abstract void showDiff(Project project, DiffRequestChain requests, DiffDialogHints hints)
SimpleDiffRequestChain
public abstract DiffRequestPanel createRequestPanel(Project project, Disposable parent, java.awt.Window window)
DiffRequest
.public abstract void showMerge(Project project, MergeRequest request)