1 11 package org.eclipse.core.internal.preferences.legacy; 12 13 import org.eclipse.core.internal.preferences.exchange.ILegacyPreferences; 14 import org.eclipse.core.internal.runtime.InternalPlatform; 15 import org.eclipse.core.runtime.Platform; 16 import org.eclipse.core.runtime.Plugin; 17 18 22 public class InitLegacyPreferences implements ILegacyPreferences { 23 36 public Object init(Object object, String name) { 37 Plugin plugin = null; 38 if (object instanceof Plugin) 39 plugin = (Plugin) object; 40 if (plugin == null && InternalPlatform.getDefault().getBundle(org.eclipse.core.internal.runtime.CompatibilityHelper.PI_RUNTIME_COMPATIBILITY) != null) 43 plugin = Platform.getPlugin(name); 44 if (plugin == null) { 45 if (InternalPlatform.DEBUG_PLUGIN_PREFERENCES) 46 InternalPlatform.message("No plug-in object available to set plug-in default preference overrides for:" + name); return null; 48 } 49 if (InternalPlatform.DEBUG_PLUGIN_PREFERENCES) 50 InternalPlatform.message("Applying plug-in default preference overrides for plug-in: " + plugin.getDescriptor().getUniqueIdentifier()); 52 plugin.internalInitializeDefaultPluginPreferences(); 53 return plugin; 54 } 55 56 } 57 | Popular Tags |