1 11 package org.eclipse.pde.internal.core; 12 13 import java.util.Locale ; 14 15 import org.eclipse.core.runtime.Platform; 16 import org.eclipse.core.runtime.Preferences; 17 import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; 18 import org.eclipse.pde.core.plugin.TargetPlatform; 19 20 public class PreferenceInitializer extends AbstractPreferenceInitializer { 21 22 27 public void initializeDefaultPreferences() { 28 Preferences preferences = PDECore.getDefault().getPluginPreferences(); 29 preferences.setDefault( 30 ICoreConstants.TARGET_MODE, 31 ICoreConstants.VALUE_USE_THIS); 32 preferences.setDefault( 33 ICoreConstants.CHECKED_PLUGINS, 34 ICoreConstants.VALUE_SAVED_ALL); 35 if (preferences.getString(ICoreConstants.TARGET_MODE).equals(ICoreConstants.VALUE_USE_THIS)) 36 preferences.setValue( 37 ICoreConstants.PLATFORM_PATH, 38 TargetPlatform.getDefaultLocation()); 39 else 40 preferences.setDefault( 41 ICoreConstants.PLATFORM_PATH, 42 TargetPlatform.getDefaultLocation()); 43 44 preferences.setDefault(ICoreConstants.OS, Platform.getOS()); 46 preferences.setDefault(ICoreConstants.WS, Platform.getWS()); 47 preferences.setDefault(ICoreConstants.NL, Locale.getDefault().toString()); 48 preferences.setDefault(ICoreConstants.ARCH, Platform.getOSArch()); 49 } 50 51 } 52 | Popular Tags |