use of org.eclipse.compare.IContentChangeListener in project egit by eclipse.
the class CompareUtils method getIndexTypedElement.
private static ITypedElement getIndexTypedElement(final Repository repository, final String gitPath, String encoding) {
IFileRevision nextFile = GitFileRevision.inIndex(repository, gitPath);
final EditableRevision next = new EditableRevision(nextFile, encoding);
IContentChangeListener listener = new IContentChangeListener() {
@Override
public void contentChanged(IContentChangeNotifier source) {
final byte[] newContent = next.getModifiedContent();
setIndexEntryContents(repository, gitPath, newContent);
}
};
next.addContentChangeListener(listener);
return next;
}
Aggregations