KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > update > internal > core > UpdatePreferencesInitializer


1 /*******************************************************************************
2  * Copyright (c) 2004, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.update.internal.core;
12
13 import org.eclipse.core.runtime.Plugin;
14 import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
15
16 /**
17  * Class to initialize the preferences for the Update core plugin.
18  */

19 public class UpdatePreferencesInitializer extends AbstractPreferenceInitializer {
20
21     /**
22      * Default constructor
23      */

24     public UpdatePreferencesInitializer() {
25         super();
26     }
27
28     /**
29      * Initializes the default preferences settings for this plug-in.
30      * <p>
31      * This method is called sometime after the preference store for this
32      * plug-in is created. Default values are never stored in preference
33      * stores; they must be filled in each time. This method provides the
34      * opportunity to initialize the default values.
35      * </p>
36      * <p>
37      * The default implementation of this method does nothing. A subclass that needs
38      * to set default values for its preferences must reimplement this method.
39      * Default values set at a later point will override any default override
40      * settings supplied from outside the plug-in (product configuration or
41      * platform start up).
42      * </p>
43      */

44     public void initializeDefaultPreferences() {
45         Plugin plugin = UpdateCore.getPlugin();
46         plugin.getPluginPreferences().setDefault(UpdateCore.P_CHECK_SIGNATURE, true);
47         plugin.getPluginPreferences().setDefault(UpdateCore.P_AUTOMATICALLY_CHOOSE_MIRROR, false);
48         plugin.getPluginPreferences().setDefault(UpdateCore.P_HISTORY_SIZE, UpdateCore.DEFAULT_HISTORY);
49         plugin.getPluginPreferences().setDefault(UpdateCore.P_UPDATE_VERSIONS, UpdateCore.EQUIVALENT_VALUE);
50     }
51 }
52
Popular Tags