01: /*******************************************************************************
02: * Copyright (c) 2004, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.internal.ide;
11:
12: import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
13: import org.eclipse.core.runtime.preferences.DefaultScope;
14: import org.eclipse.core.runtime.preferences.IEclipsePreferences;
15: import org.eclipse.ui.IWorkbenchActionConstants;
16: import org.eclipse.ui.IWorkbenchPreferenceConstants;
17: import org.eclipse.ui.ide.IDE;
18:
19: /**
20: * The IDEPreferenceInitializer is the preference initializer for the IDE
21: * preferences.
22: */
23: public class IDEPreferenceInitializer extends
24: AbstractPreferenceInitializer {
25:
26: /*
27: * (non-Javadoc)
28: *
29: * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
30: */
31: public void initializeDefaultPreferences() {
32:
33: IEclipsePreferences node = new DefaultScope()
34: .getNode(IDEWorkbenchPlugin.getDefault().getBundle()
35: .getSymbolicName());
36:
37: // API preferences
38:
39: node.put(IDE.Preferences.PROJECT_OPEN_NEW_PERSPECTIVE,
40: IWorkbenchPreferenceConstants.OPEN_PERSPECTIVE_REPLACE);
41:
42: // Set the workspace selection dialog to open by default
43: node.putBoolean(
44: IDE.Preferences.SHOW_WORKSPACE_SELECTION_DIALOG, true);
45:
46: // Internal preferences
47:
48: node.putBoolean(IDEInternalPreferences.SAVE_ALL_BEFORE_BUILD,
49: false);
50: node.putInt(IDEInternalPreferences.SAVE_INTERVAL, 5); // 5 minutes
51: node.putBoolean(IDEInternalPreferences.WELCOME_DIALOG, true);
52: node.putBoolean(
53: IDEInternalPreferences.REFRESH_WORKSPACE_ON_STARTUP,
54: false);
55: node
56: .putBoolean(
57: IDEInternalPreferences.EXIT_PROMPT_ON_CLOSE_LAST_WINDOW,
58: true);
59: node.put(IDEInternalPreferences.PROJECT_SWITCH_PERSP_MODE,
60: IDEInternalPreferences.PSPM_PROMPT);
61: node.put(IDEInternalPreferences.OPEN_REQUIRED_PROJECTS,
62: IDEInternalPreferences.PSPM_PROMPT);
63:
64: // Turning some Help Menu separators on
65: node.putBoolean(getHelpSeparatorKey("group.main"), true); //$NON-NLS-1$
66: node.putBoolean(getHelpSeparatorKey("group.assist"), true); //$NON-NLS-1$
67: node.putBoolean(getHelpSeparatorKey("group.updates"), true); //$NON-NLS-1$
68:
69: // Set up marker limits
70: node.putBoolean(IDEInternalPreferences.LIMIT_PROBLEMS, true);
71: node.putInt(IDEInternalPreferences.PROBLEMS_LIMIT, 100);
72:
73: node.putBoolean(IDEInternalPreferences.LIMIT_BOOKMARKS, true);
74: node.putInt(IDEInternalPreferences.BOOKMARKS_LIMIT, 100);
75:
76: node.putBoolean(IDEInternalPreferences.LIMIT_TASKS, true);
77: node.putInt(IDEInternalPreferences.TASKS_LIMIT, 100);
78: }
79:
80: private String getHelpSeparatorKey(String groupId) {
81: return "useSeparator." + IWorkbenchActionConstants.M_HELP + "." + groupId; //$NON-NLS-1$ //$NON-NLS-2$
82: }
83: }
|