use of org.eclipse.compare.contentmergeviewer.TextMergeViewer in project n4js by eclipse.
the class PackageJsonComparePage method createPreviewer.
private Control createPreviewer(Composite parent) {
final CompareConfiguration compareConfiguration = new CompareConfiguration();
compareConfiguration.setLeftLabel("Original package.json");
compareConfiguration.setLeftEditable(false);
compareConfiguration.setRightLabel("Merged package.json");
compareConfiguration.setRightEditable(false);
compareConfiguration.setProperty(CompareConfiguration.IGNORE_WHITESPACE, Boolean.FALSE);
fViewer = new TextMergeViewer(parent, SWT.NONE, compareConfiguration);
// add initial input in order to avoid problems when disposing the viewer later:
fViewer.setInput(new DiffNode(new DiffElementFromString(""), new DiffElementFromString("")));
Control control = fViewer.getControl();
control.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
compareConfiguration.dispose();
}
});
return control;
}
Aggregations