View Javadoc

1   /*
2    * $Id: SWeDECorePreferenceInitializer.java,v 1.4 2005/05/31 16:04:12 jlerner Exp $
3    *
4    * Copyright (c) 1999-2004, BBN Technologies, LLC.
5    * All rights reserved.
6    * http://www.daml.org/legal/opensource/bbn_license.html
7    */
8    
9   package com.bbn.swede.core;
10  
11  import org.eclipse.core.runtime.Preferences;
12  import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
13  
14  /***
15   * Class to initialize SWeDE Core plugin preferences.
16   * See {@link AbstractPreferenceInitializer} for more details about 
17   * this mechanism.
18   *  
19   * @see AbstractPreferenceInitializer
20   * @author aperezlo
21   */
22  public class SWeDECorePreferenceInitializer extends
23     AbstractPreferenceInitializer
24  {
25     //By default, auto-update libraries every 14 days
26     private static final long MILLISECONDS_PER_DAY = 86400000; // = 1000 * 60 * 60 * 24;
27     private static final long DEFAULT_UPDATE_FREQUENCY_DAYS = 14;
28  
29     /*
30      *  (non-Javadoc)
31      * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
32      */
33     public void initializeDefaultPreferences()
34     {
35        Preferences p = OWLCore.getPlugin().getPluginPreferences();
36        p.setDefault(OWLCore.PREFERENCE_LIBRARY_AUTOMATIC_UPDATE, false);
37        p.setDefault(OWLCore.PREFERENCE_LIBRARY_UPDATE_SCHEDULE_FREQUENCY_STR,
38           DEFAULT_UPDATE_FREQUENCY_DAYS * MILLISECONDS_PER_DAY); 
39        p.setDefault(OWLCore.PREFERENCE_LIBRARY_UPDATE_SCHEDULE_LAST_TIME_STR, System.currentTimeMillis());
40     }
41  
42  }