1 11 package org.eclipse.core.internal.resources; 12 13 import org.eclipse.core.resources.ResourcesPlugin; 14 import org.eclipse.core.runtime.preferences.*; 15 16 19 public class PreferenceInitializer extends AbstractPreferenceInitializer { 20 21 public static final String PREF_OPERATIONS_PER_SNAPSHOT = "snapshots.operations"; public static final String PREF_DELTA_EXPIRATION = "delta.expiration"; 25 public static final boolean PREF_AUTO_REFRESH_DEFAULT = false; 27 public static final boolean PREF_DISABLE_LINKING_DEFAULT = false; 28 public static final String PREF_ENCODING_DEFAULT = ""; public static final boolean PREF_AUTO_BUILDING_DEFAULT = true; 30 public static final String PREF_BUILD_ORDER_DEFAULT = ""; public static final int PREF_MAX_BUILD_ITERATIONS_DEFAULT = 10; 32 public static final boolean PREF_DEFAULT_BUILD_ORDER_DEFAULT = true; 33 public final static long PREF_SNAPSHOT_INTERVAL_DEFAULT = 5 * 60 * 1000l; public static final int PREF_OPERATIONS_PER_SNAPSHOT_DEFAULT = 100; 35 public static final long PREF_FILE_STATE_LONGEVITY_DEFAULT = 7 * 24 * 3600 * 1000l; public static final long PREF_MAX_FILE_STATE_SIZE_DEFAULT = 1024 * 1024l; public static final int PREF_MAX_FILE_STATES_DEFAULT = 50; 38 public static final long PREF_DELTA_EXPIRATION_DEFAULT = 30 * 24 * 3600 * 1000l; 40 public PreferenceInitializer() { 41 super(); 42 } 43 44 47 public void initializeDefaultPreferences() { 48 IEclipsePreferences node = new DefaultScope().getNode(ResourcesPlugin.PI_RESOURCES); 49 node.putBoolean(ResourcesPlugin.PREF_AUTO_REFRESH, PREF_AUTO_REFRESH_DEFAULT); 51 52 node.putBoolean(ResourcesPlugin.PREF_DISABLE_LINKING, PREF_DISABLE_LINKING_DEFAULT); 54 55 node.putBoolean(ResourcesPlugin.PREF_AUTO_BUILDING, PREF_AUTO_BUILDING_DEFAULT); 57 node.put(ResourcesPlugin.PREF_BUILD_ORDER, PREF_BUILD_ORDER_DEFAULT); 58 node.putInt(ResourcesPlugin.PREF_MAX_BUILD_ITERATIONS, PREF_MAX_BUILD_ITERATIONS_DEFAULT); 59 node.putBoolean(ResourcesPlugin.PREF_DEFAULT_BUILD_ORDER, PREF_DEFAULT_BUILD_ORDER_DEFAULT); 60 61 node.putLong(ResourcesPlugin.PREF_FILE_STATE_LONGEVITY, PREF_FILE_STATE_LONGEVITY_DEFAULT); 63 node.putLong(ResourcesPlugin.PREF_MAX_FILE_STATE_SIZE, PREF_MAX_FILE_STATE_SIZE_DEFAULT); 64 node.putInt(ResourcesPlugin.PREF_MAX_FILE_STATES, PREF_MAX_FILE_STATES_DEFAULT); 65 66 node.putLong(ResourcesPlugin.PREF_SNAPSHOT_INTERVAL, PREF_SNAPSHOT_INTERVAL_DEFAULT); 68 node.putInt(PREF_OPERATIONS_PER_SNAPSHOT, PREF_OPERATIONS_PER_SNAPSHOT_DEFAULT); 69 node.putLong(PREF_DELTA_EXPIRATION, PREF_DELTA_EXPIRATION_DEFAULT); 70 71 node.put(ResourcesPlugin.PREF_ENCODING, PREF_ENCODING_DEFAULT); 73 } 74 75 } 76 | Popular Tags |