summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Aniola2013-01-02 08:01:45 (EST)
committer Malgorzata Janczarska2013-01-02 08:40:06 (EST)
commitfc10007c254253c9532ce2f473572e6316ff1aae (patch)
tree0d66d04815104046adc98451f30bdf8aa354c6f3
parent5475c67de7d00c4ba85f6fd1989a3480b2e9422b (diff)
downloadeclipse.platform.team-fc10007c254253c9532ce2f473572e6316ff1aae.zip
eclipse.platform.team-fc10007c254253c9532ce2f473572e6316ff1aae.tar.gz
eclipse.platform.team-fc10007c254253c9532ce2f473572e6316ff1aae.tar.bz2
Bug 383893 - Casting to ContentMergeViewer breaks Viewer contributionsv20130102-134006I20130127-2000I20130122-0800I20130115-1300I20130115-0800I20130108-0800
to EP org.eclipse.compare.contentMergeViewers, with an org.eclipse.compare.IViewerCreator, that provides just an org.eclipse.jface.viewers.Viewer
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java20
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java35
2 files changed, 33 insertions, 22 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
index 85a8c5f..5922600 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -1152,15 +1152,21 @@ public abstract class CompareEditorInput extends PlatformObject implements IEdit
private void setDirty(Object source, boolean dirty) {
Assert.isNotNull(source);
boolean oldDirty = isSaveNeeded();
- ContentMergeViewer cmv = (ContentMergeViewer) source;
- if (dirty == cmv.internalIsLeftDirty()) {
- fLeftDirty = cmv.internalIsLeftDirty();
- }
+ if (source instanceof ContentMergeViewer) {
+ ContentMergeViewer cmv = (ContentMergeViewer) source;
+
+ if (dirty == cmv.internalIsLeftDirty()) {
+ fLeftDirty = cmv.internalIsLeftDirty();
+ }
- if (dirty == cmv.internalIsRightDirty()) {
- fRightDirty = cmv.internalIsRightDirty();
+ if (dirty == cmv.internalIsRightDirty()) {
+ fRightDirty = cmv.internalIsRightDirty();
+ }
+ } else {
+ fLeftDirty = dirty;
}
+
boolean newDirty = isSaveNeeded();
if (DEBUG) {
System.out.println("setDirty(" + source + ", " + dirty + "): " + newDirty); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java
index afa44be..ea3f947 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -287,22 +287,27 @@ public abstract class LocalResourceSaveableComparison extends SaveableComparison
if (newValue instanceof Boolean)
changed= ((Boolean)newValue).booleanValue();
- ContentMergeViewer cmv = (ContentMergeViewer) e.getSource();
-
- if (input.getLeft() != null && input.getLeft().equals(fileElement)) {
- if (changed && cmv.internalIsLeftDirty())
- setDirty(changed);
- else if (!changed && !cmv.internalIsLeftDirty()) {
- setDirty(changed);
+ Object source = e.getSource();
+ if (source instanceof ContentMergeViewer) {
+ ContentMergeViewer cmv = (ContentMergeViewer) source;
+ if (input.getLeft() != null
+ && input.getLeft().equals(fileElement)) {
+ if (changed && cmv.internalIsLeftDirty())
+ setDirty(changed);
+ else if (!changed && !cmv.internalIsLeftDirty()) {
+ setDirty(changed);
+ }
}
- }
- if (input.getRight() != null
- && input.getRight().equals(fileElement)) {
- if (changed && cmv.internalIsRightDirty())
- setDirty(changed);
- else if (!changed && !cmv.internalIsRightDirty()) {
- setDirty(changed);
+ if (input.getRight() != null
+ && input.getRight().equals(fileElement)) {
+ if (changed && cmv.internalIsRightDirty())
+ setDirty(changed);
+ else if (!changed && !cmv.internalIsRightDirty()) {
+ setDirty(changed);
+ }
}
+ } else {
+ setDirty(changed);
}
}
}