Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2003-06-12 10:22:11 -0400
committerJean Michel-Lemieux2003-06-12 10:22:11 -0400
commit72b93ae88b4bdf7b1619ae6b66eb77bcfc1eea51 (patch)
treea733f4d654d5fa6682bf835b815467eef51540aa
parentdfbdef57b6315f094644e083d2399c2407fe8366 (diff)
downloadeclipse.platform.team-72b93ae88b4bdf7b1619ae6b66eb77bcfc1eea51.tar.gz
eclipse.platform.team-72b93ae88b4bdf7b1619ae6b66eb77bcfc1eea51.tar.xz
eclipse.platform.team-72b93ae88b4bdf7b1619ae6b66eb77bcfc1eea51.zip
Allow saving via the context menu of the text merge view
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/compare/SyncInfoCompareInput.java22
1 files changed, 20 insertions, 2 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/compare/SyncInfoCompareInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/compare/SyncInfoCompareInput.java
index 78c5c2f6e..f7a93bbaa 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/compare/SyncInfoCompareInput.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/compare/SyncInfoCompareInput.java
@@ -14,10 +14,13 @@ import java.lang.reflect.InvocationTargetException;
import org.eclipse.compare.CompareConfiguration;
import org.eclipse.compare.CompareEditorInput;
+import org.eclipse.compare.IContentChangeListener;
+import org.eclipse.compare.IContentChangeNotifier;
import org.eclipse.compare.ITypedElement;
import org.eclipse.compare.structuremergeviewer.DiffNode;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.team.core.subscribers.SyncInfo;
import org.eclipse.team.internal.ui.Policy;
@@ -35,9 +38,24 @@ public class SyncInfoCompareInput extends CompareEditorInput {
this.sync = sync;
ITypedElement elements[] = SyncInfoDiffNode.getTypedElements(sync);
- this.node = new SyncInfoDiffNode(elements[0], elements[1], elements[2], sync.getKind());
+ this.node = new SyncInfoDiffNode(elements[0] /* base */, elements[1] /* local */, elements[2] /* remote */, sync.getKind());
+ initializeContentChangeListeners();
}
+ private void initializeContentChangeListeners() {
+ ITypedElement te = node.getLeft();
+ if(te instanceof IContentChangeNotifier) {
+ ((IContentChangeNotifier)te).addContentChangeListener(new IContentChangeListener() {
+ public void contentChanged(IContentChangeNotifier source) {
+ try {
+ saveChanges(new NullProgressMonitor());
+ } catch (CoreException e) {
+ }
+ }
+ });
+ }
+ }
+
/* (non-Javadoc)
* @see org.eclipse.compare.CompareEditorInput#prepareInput(org.eclipse.core.runtime.IProgressMonitor)
*/
@@ -84,7 +102,7 @@ public class SyncInfoCompareInput extends CompareEditorInput {
try {
commit(pm, (DiffNode) node);
} finally {
- setDirty(false);
+ setDirty(false);
}
}
}

Back to the top