01: package net.refractions.udig.project.preferences;
02:
03: import java.awt.Color;
04:
05: import net.refractions.udig.project.internal.ProjectPlugin;
06: import net.refractions.udig.project.internal.interceptor.ResourceCacheInterceptor;
07:
08: import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
09: import org.eclipse.jface.preference.IPreferenceStore;
10: import org.eclipse.jface.preference.PreferenceConverter;
11: import org.eclipse.swt.graphics.RGB;
12:
13: /**
14: * Class used to initialize default preference values.
15: */
16: public class PreferenceInitializer extends
17: AbstractPreferenceInitializer {
18: public static final String P_DEFAULT_FEATURE_EDITOR_VALUE = "net.refractions.udig.tool.select.view"; //$NON-NLS-1$
19:
20: public void initializeDefaultPreferences() {
21: IPreferenceStore store = ProjectPlugin.getPlugin()
22: .getPreferenceStore();
23: store.setDefault(PreferenceConstants.P_REMOVE_LAYERS, true);
24: store.setDefault(
25: PreferenceConstants.P_WARN_IRREVERSIBLE_COMMAND, true);
26: store.setDefault(PreferenceConstants.P_ANTI_ALIASING, true);
27: store.setDefault(PreferenceConstants.P_DEFAULT_CRS, 4326);
28: store.setDefault(PreferenceConstants.P_TRANSPARENCY, true);
29: store.setDefault(PreferenceConstants.P_TILING_RENDERER, false);
30: store.setDefault(PreferenceConstants.P_HIGHLIGHT,
31: PreferenceConstants.P_HIGHLIGHT_NONE);
32: store
33: .setDefault(PreferenceConstants.P_DEFAULT_PALETTE,
34: "Dark2"); //$NON-NLS-1$
35: store
36: .setDefault(
37: PreferenceConstants.P_STYLE_DEFAULT_PERPENDICULAR_OFFSET,
38: "10"); //$NON-NLS-1$
39: store.setDefault(
40: PreferenceConstants.P_LAYER_RESOURCE_CACHING_STRATEGY,
41: ResourceCacheInterceptor.ID);
42: store.setDefault(PreferenceConstants.P_PROJECT_DELETE_FILES,
43: true);
44: store.setDefault(PreferenceConstants.P_SHOW_ANIMATIONS, true);
45: store.setDefault(PreferenceConstants.P_MAX_UNDO, 10);
46: store.setDefault(PreferenceConstants.P_DEFAULT_FEATURE_EDITOR,
47: P_DEFAULT_FEATURE_EDITOR_VALUE);
48:
49: PreferenceConverter.setDefault(store,
50: PreferenceConstants.P_BACKGROUND,
51: new RGB(255, 255, 255));
52: Color yellow = Color.YELLOW;
53: PreferenceConverter
54: .setDefault(store,
55: PreferenceConstants.P_SELECTION_COLOR, new RGB(
56: yellow.getRed(), yellow.getGreen(),
57: yellow.getBlue()));
58: }
59:
60: }
|