Class UnifiedDiff
java.lang.Object
org.eclipse.compare.unifieddiff.UnifiedDiff
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic interfacestatic interfacestatic enumIdentifies a built-in action of a unified diff toolbar, so that its text or image can be replaced. -
Method Summary
Modifier and TypeMethodDescriptionstatic UnifiedDiff.Buildercreate(ITextEditor editor, String source, UnifiedDiffMode mode) Shows the unified diff in the given editor.static voiddispose(ITextEditor editor) Removes the unified diff display from the given editor without changing its document or computing another diff.
-
Method Details
-
create
Shows the unified diff in the given editor.- Parameters:
editor- the text editor where the diff will be shownsource- the source content to comparemode- the mode in which the diff will be displayed- Returns:
- a builder to configure and open the unified diff
-
dispose
Removes the unified diff display from the given editor without changing its document or computing another diff. Clears diff annotations and code minings, disposes diff toolbars and listeners, removes diff folds, restores the editor's navigation actions, and prevents a pending diff computation from restoring the display. Annotations unrelated to the diff are preserved.Must be called on the editor's UI thread. Has no effect when the editor has no unified diff or no live text viewer. A new diff can be opened afterwards.
- Parameters:
editor- the text editor whose unified diff display is removed- Throws:
NullPointerException- if the editor isnull- Since:
- 3.13
-