Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcvs2001-05-11 10:35:07 -0400
committercvs2001-05-11 10:35:07 -0400
commitb850a81a27339f63c321ab7669623421e4b43328 (patch)
tree74573f455628efe4fcd8490969637c336564ff73 /bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer
parent9a94b6d48f7100240fb64e4b74a7bbe2ba11d4bb (diff)
downloadeclipse.platform.team-b850a81a27339f63c321ab7669623421e4b43328.tar.gz
eclipse.platform.team-b850a81a27339f63c321ab7669623421e4b43328.tar.xz
eclipse.platform.team-b850a81a27339f63c321ab7669623421e4b43328.zip
Added Preference Page
Diffstat (limited to 'bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer')
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java29
1 files changed, 25 insertions, 4 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java
index bfbcbb742..3a4a12546 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java
@@ -17,6 +17,7 @@ import org.eclipse.swt.widgets.*;
import org.eclipse.jface.util.*;
import org.eclipse.jface.action.*;
import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.compare.internal.*;
import org.eclipse.compare.*;
@@ -120,6 +121,7 @@ public class DiffTreeViewer extends TreeViewer {
private CompareConfiguration fCompareConfiguration;
private ViewerFilter fViewerFilter;
private IPropertyChangeListener fPropertyChangeListener;
+ private IPropertyChangeListener fPreferenceChangeListener;
private Action fCopyLeftToRightAction;
private Action fCopyRightToLeftAction;
@@ -158,6 +160,7 @@ public class DiffTreeViewer extends TreeViewer {
fBundle= ResourceBundle.getBundle("org.eclipse.compare.structuremergeviewer.DiffTreeViewerResources");
+ // register for notification with the CompareConfiguration
fCompareConfiguration= configuration;
if (fCompareConfiguration != null) {
fPropertyChangeListener= new IPropertyChangeListener() {
@@ -165,10 +168,21 @@ public class DiffTreeViewer extends TreeViewer {
DiffTreeViewer.this.propertyChange(event);
}
};
-
fCompareConfiguration.addPropertyChangeListener(fPropertyChangeListener);
- }
+ }
+
+ // register for notification with the Compare plugin's PreferenceStore
+ fPreferenceChangeListener= new IPropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent event) {
+ if (event.getProperty().equals(CompareConfiguration.SHOW_PSEUDO_CONFLICTS))
+ syncShowPseudoConflictFilter();
+ }
+ };
+ IPreferenceStore ps= CompareUIPlugin.getDefault().getPreferenceStore();
+ if (ps != null)
+ ps.addPropertyChangeListener(fPreferenceChangeListener);
+
setContentProvider(new DiffViewerContentProvider());
setLabelProvider(new DiffViewerLabelProvider());
@@ -243,6 +257,13 @@ public class DiffTreeViewer extends TreeViewer {
* Clients may extend if they have to do additional cleanup.
*/
protected void handleDispose(DisposeEvent event) {
+
+ if (fPreferenceChangeListener != null) {
+ IPreferenceStore ps= CompareUIPlugin.getDefault().getPreferenceStore();
+ if (ps != null)
+ ps.addPropertyChangeListener(fPreferenceChangeListener);
+ fPreferenceChangeListener= null;
+ }
if (fCompareConfiguration != null) {
if (fPropertyChangeListener != null)
@@ -260,8 +281,8 @@ public class DiffTreeViewer extends TreeViewer {
*/
protected void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(CompareConfiguration.SHOW_PSEUDO_CONFLICTS))
- syncShowPseudoConflictFilter();
+ //if (event.getProperty().equals(CompareConfiguration.SHOW_PSEUDO_CONFLICTS))
+ // syncShowPseudoConflictFilter();
}
protected void inputChanged(Object in, Object oldInput) {

Back to the top