Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 315747
Collapse All | Expand All

(-)a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CVSSubscriberMergeContext.java (-1 / +9 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2006, 2007 IBM Corporation and others.
2
 * Copyright (c) 2006, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 29-34 import org.eclipse.team.internal.ccvs.core.resources.EclipseSynchronizer; Link Here
29
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
29
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
30
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
30
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
31
import org.eclipse.team.internal.ccvs.ui.Policy;
31
import org.eclipse.team.internal.ccvs.ui.Policy;
32
import org.eclipse.team.internal.core.subscribers.SubscriberDiffTreeEventHandler;
32
33
33
public abstract class CVSSubscriberMergeContext extends SubscriberMergeContext {
34
public abstract class CVSSubscriberMergeContext extends SubscriberMergeContext {
34
35
Lines 245-248 public abstract class CVSSubscriberMergeContext extends SubscriberMergeContext { Link Here
245
		return super.getAdapter(adapter);
246
		return super.getAdapter(adapter);
246
	}
247
	}
247
248
249
	protected SubscriberDiffTreeEventHandler getHandler() {
250
		Object o = getAdapter(SubscriberDiffTreeEventHandler.class);
251
		if (o instanceof SubscriberDiffTreeEventHandler) {
252
			return (SubscriberDiffTreeEventHandler) o;
253
		}
254
		return null;
255
	}
248
}
256
}
(-)a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/CompareSubscriberContext.java (-11 / +36 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2006 IBM Corporation and others.
2
 * Copyright (c) 2006, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 10-26 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.team.internal.ccvs.ui.mappings;
11
package org.eclipse.team.internal.ccvs.ui.mappings;
12
12
13
import org.eclipse.core.runtime.CoreException;
13
import org.eclipse.core.runtime.*;
14
import org.eclipse.core.runtime.IProgressMonitor;
14
import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
15
import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
15
import org.eclipse.team.core.diff.DiffFilter;
16
import org.eclipse.team.core.diff.DiffFilter;
16
import org.eclipse.team.core.diff.IDiff;
17
import org.eclipse.team.core.diff.IDiff;
17
import org.eclipse.team.core.mapping.ISynchronizationScopeManager;
18
import org.eclipse.team.core.mapping.ISynchronizationScopeManager;
18
import org.eclipse.team.core.mapping.provider.SynchronizationContext;
19
import org.eclipse.team.core.mapping.provider.SynchronizationContext;
19
import org.eclipse.team.core.subscribers.Subscriber;
20
import org.eclipse.team.core.subscribers.Subscriber;
20
import org.eclipse.team.internal.ccvs.core.CVSCompareSubscriber;
21
import org.eclipse.team.internal.ccvs.core.CVSCompareSubscriber;
22
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
23
import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
21
import org.eclipse.team.internal.core.subscribers.ContentComparisonDiffFilter;
24
import org.eclipse.team.internal.core.subscribers.ContentComparisonDiffFilter;
25
import org.eclipse.team.internal.core.subscribers.SubscriberDiffTreeEventHandler;
22
26
23
public class CompareSubscriberContext extends CVSSubscriberMergeContext {
27
public class CompareSubscriberContext extends CVSSubscriberMergeContext implements IPropertyChangeListener {
24
28
25
	public static SynchronizationContext createContext(ISynchronizationScopeManager manager, CVSCompareSubscriber subscriber) {
29
	public static SynchronizationContext createContext(ISynchronizationScopeManager manager, CVSCompareSubscriber subscriber) {
26
		CompareSubscriberContext mergeContext = new CompareSubscriberContext(subscriber, manager);
30
		CompareSubscriberContext mergeContext = new CompareSubscriberContext(subscriber, manager);
Lines 30-35 public class CompareSubscriberContext extends CVSSubscriberMergeContext { Link Here
30
	
34
	
31
	protected CompareSubscriberContext(Subscriber subscriber, ISynchronizationScopeManager manager) {
35
	protected CompareSubscriberContext(Subscriber subscriber, ISynchronizationScopeManager manager) {
32
		super(subscriber, manager);
36
		super(subscriber, manager);
37
		CVSUIPlugin.getPlugin().getPluginPreferences().addPropertyChangeListener(this);
38
	}
39
40
	/* (non-Javadoc)
41
	 * @see org.eclipse.team.core.subscribers.SubscriberMergeContext#dispose()
42
	 */
43
	public void dispose() {
44
		super.dispose();
45
		CVSUIPlugin.getPlugin().getPluginPreferences().removePropertyChangeListener(this);
33
	}
46
	}
34
47
35
	/* (non-Javadoc)
48
	/* (non-Javadoc)
Lines 44-56 public class CompareSubscriberContext extends CVSSubscriberMergeContext { Link Here
44
	 * @see org.eclipse.team.core.subscribers.SubscriberMergeContext#getDiffFilter()
57
	 * @see org.eclipse.team.core.subscribers.SubscriberMergeContext#getDiffFilter()
45
	 */
58
	 */
46
	protected DiffFilter getDiffFilter() {
59
	protected DiffFilter getDiffFilter() {
47
		// Return a filter that selects any diffs whose contents are not equal
60
		if (CVSUIPlugin.getPlugin().getPluginPreferences().getBoolean(ICVSUIConstants.PREF_CONSIDER_CONTENTS)) {
48
		final DiffFilter contentsEqual = new ContentComparisonDiffFilter(false);
61
			// Return a filter that selects any diffs whose contents are not equal
49
		return new DiffFilter() {
62
			final DiffFilter contentsEqual = new ContentComparisonDiffFilter(false);
50
			public boolean select(IDiff diff, IProgressMonitor monitor) {
63
			return new DiffFilter() {
51
				return !contentsEqual.select(diff, monitor);
64
				public boolean select(IDiff diff, IProgressMonitor monitor) {
52
			}
65
					return !contentsEqual.select(diff, monitor);
53
		};
66
				}
67
			};
68
		}
69
		return null;
54
	}
70
	}
55
71
72
	public void propertyChange(PropertyChangeEvent event) {
73
		if (event.getProperty().equals(ICVSUIConstants.PREF_CONSIDER_CONTENTS)) {
74
			SubscriberDiffTreeEventHandler handler = getHandler();
75
			if (handler != null) {
76
				handler.setFilter(getDiffFilter());
77
				handler.reset();
78
			}
79
		}
80
	}
56
}
81
}
(-)a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/WorkspaceSubscriberContext.java (-9 / +1 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2006 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 318-331 public class WorkspaceSubscriberContext extends CVSSubscriberMergeContext { Link Here
318
		}
318
		}
319
	}
319
	}
320
	
320
	
321
	private SubscriberDiffTreeEventHandler getHandler() {
322
		Object o = getAdapter(SubscriberDiffTreeEventHandler.class);
323
		if (o instanceof SubscriberDiffTreeEventHandler) {
324
			return (SubscriberDiffTreeEventHandler) o;
325
		}
326
		return null;
327
	}
328
329
	private GroupProgressMonitor getGroup(IProgressMonitor monitor) {
321
	private GroupProgressMonitor getGroup(IProgressMonitor monitor) {
330
		if (monitor instanceof GroupProgressMonitor) {
322
		if (monitor instanceof GroupProgressMonitor) {
331
			return (GroupProgressMonitor) monitor;
323
			return (GroupProgressMonitor) monitor;

Return to bug 315747