View | Details | Raw Unified | Return to bug 229073 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/pde/internal/ui/wizards/ListUtil.java (-2 / +19 lines)
Lines 11-21 Link Here
11
package org.eclipse.pde.internal.ui.wizards;
11
package org.eclipse.pde.internal.ui.wizards;
12
12
13
import java.util.Comparator;
13
import java.util.Comparator;
14
import org.eclipse.jface.util.Policy;
14
import org.eclipse.jface.util.*;
15
import org.eclipse.jface.viewers.*;
15
import org.eclipse.jface.viewers.*;
16
import org.eclipse.pde.core.plugin.*;
16
import org.eclipse.pde.core.plugin.*;
17
import org.eclipse.pde.internal.core.ifeature.IFeature;
17
import org.eclipse.pde.internal.core.ifeature.IFeature;
18
import org.eclipse.pde.internal.core.ifeature.IFeatureModel;
18
import org.eclipse.pde.internal.core.ifeature.IFeatureModel;
19
import org.eclipse.pde.internal.ui.IPreferenceConstants;
19
import org.eclipse.pde.internal.ui.PDEPlugin;
20
import org.eclipse.pde.internal.ui.PDEPlugin;
20
import org.eclipse.pde.internal.ui.elements.ElementLabelProvider;
21
import org.eclipse.pde.internal.ui.elements.ElementLabelProvider;
21
import org.eclipse.pde.internal.ui.nls.ModelChange;
22
import org.eclipse.pde.internal.ui.nls.ModelChange;
Lines 60-65 Link Here
60
	}
61
	}
61
62
62
	public static class PluginComparator extends NameComparator {
63
	public static class PluginComparator extends NameComparator {
64
65
		private static IPropertyChangeListener listener = new IPropertyChangeListener() {
66
67
			public void propertyChange(PropertyChangeEvent event) {
68
				if (IPreferenceConstants.PROP_SHOW_OBJECTS.equals(event.getProperty())) {
69
					cachedIsFullNameModelEnabled = IPreferenceConstants.VALUE_USE_NAMES.equals(event.getNewValue());
70
				}
71
			}
72
		};
73
74
		static {
75
			PDEPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(listener);
76
		}
77
78
		private static boolean cachedIsFullNameModelEnabled = PDEPlugin.isFullNameModeEnabled();
79
63
		public int compare(Viewer viewer, Object e1, Object e2) {
80
		public int compare(Viewer viewer, Object e1, Object e2) {
64
			int result = 0;
81
			int result = 0;
65
			String name1 = getName(e1);
82
			String name1 = getName(e1);
Lines 84-90 Link Here
84
		}
101
		}
85
102
86
		private String getPluginName(IPluginBase pluginBase) {
103
		private String getPluginName(IPluginBase pluginBase) {
87
			return PDEPlugin.isFullNameModeEnabled() ? pluginBase.getTranslatedName() : pluginBase.getId();
104
			return cachedIsFullNameModelEnabled ? pluginBase.getTranslatedName() : pluginBase.getId();
88
		}
105
		}
89
	}
106
	}
90
107

Return to bug 229073