View Javadoc

1   /*
2    * This file is a part of CAST project.
3    * (c) Copyright 2007, AGH University of Science & Technology
4    * https://caribou.iisg.agh.edu.pl/trac/cast
5    *
6    * Licensed under the Eclipse Public License, Version 1.0 (the "License").
7    * You may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    * http://www.eclipse.org/legal/epl-v10.html
10   */
11  /*
12   * File: GeneralPreferencesPage.java
13   * Created: 2007-00-00
14   * Author: entrop
15   * $Id: GeneralPreferencesPage.java 3266 2009-08-27 15:28:45Z tmilos $
16   */
17  
18  package pl.edu.agh.cast.ui.preferences;
19  
20  import org.eclipse.core.runtime.preferences.InstanceScope;
21  import org.eclipse.jface.preference.BooleanFieldEditor;
22  import org.eclipse.jface.preference.FieldEditorPreferencePage;
23  import org.eclipse.jface.preference.IPreferenceStore;
24  import org.eclipse.ui.IWorkbench;
25  import org.eclipse.ui.IWorkbenchPreferencePage;
26  import org.eclipse.ui.preferences.ScopedPreferenceStore;
27  
28  import pl.edu.agh.cast.Activator;
29  import pl.edu.agh.cast.project.UserPreferences;
30  import pl.edu.agh.cast.util.Messages;
31  
32  /**
33   * General CAST preferences.
34   *
35   * @author AGH CAST Team
36   */
37  public final class GeneralPreferencesPage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
38  
39  	/**
40  	 * {@inheritDoc}
41  	 *
42  	 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
43  	 */
44  	public void init(IWorkbench workbench) {
45  		IPreferenceStore store = new ScopedPreferenceStore(new InstanceScope(), Activator.PLUGIN_ID);
46  		setPreferenceStore(store);
47  	}
48  
49  	/**
50  	 * {@inheritDoc}
51  	 *
52  	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
53  	 */
54  	@Override
55  	protected void createFieldEditors() {
56  		addField(new BooleanFieldEditor(UserPreferences.Pref.SHOW_PROJECT_STARTUP_DIALOG.getValue(),
57  		        Messages.GeneralPreferencesPage_ShowStartup, getFieldEditorParent()));
58  	}
59  
60  }