Search in sources :

Example 1 with IContentChangeListener

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;
}
Also used : IContentChangeNotifier(org.eclipse.compare.IContentChangeNotifier) IContentChangeListener(org.eclipse.compare.IContentChangeListener) IFileRevision(org.eclipse.team.core.history.IFileRevision) EditableRevision(org.eclipse.egit.ui.internal.revision.EditableRevision)

Aggregations

IContentChangeListener (org.eclipse.compare.IContentChangeListener)1 IContentChangeNotifier (org.eclipse.compare.IContentChangeNotifier)1 EditableRevision (org.eclipse.egit.ui.internal.revision.EditableRevision)1 IFileRevision (org.eclipse.team.core.history.IFileRevision)1