1 /*******************************************************************************
\r
2 * Copyright (c) 2012 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * Semantum Oy - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.workbench.internal.preferences;
\r
14 import org.eclipse.core.runtime.preferences.InstanceScope;
\r
15 import org.eclipse.jface.preference.ComboFieldEditor;
\r
16 import org.eclipse.jface.preference.FieldEditorPreferencePage;
\r
17 import org.eclipse.jface.preference.IPreferenceStore;
\r
18 import org.eclipse.ui.IWorkbench;
\r
19 import org.eclipse.ui.IWorkbenchPreferencePage;
\r
20 import org.eclipse.ui.preferences.ScopedPreferenceStore;
\r
21 import org.simantics.ModelBrowserPreferences;
\r
24 * @author Antti Villberg <antti.villberg@semantum.fi>
\r
26 public class ModelBrowserPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
\r
28 public ModelBrowserPreferencePage() {
\r
30 IPreferenceStore pf = new ScopedPreferenceStore(InstanceScope.INSTANCE, ModelBrowserPreferences.P_NODE);
\r
31 setPreferenceStore( pf );
\r
35 protected void createFieldEditors() {
\r
37 String[][] namesAndValues = {
\r
38 new String[] { "Shared Ontologies", ModelBrowserPreferences.ONTOLOGY_VISIBILITY_SHARED },
\r
39 new String[] { "All Ontologies", ModelBrowserPreferences.ONTOLOGY_VISIBILITY_ALL }
\r
42 ComboFieldEditor ontologyVisibility = new ComboFieldEditor(ModelBrowserPreferences.P_ONTOLOGY_VISIBILITY, "Ontology Visibility", namesAndValues, getFieldEditorParent());
\r
43 addField(ontologyVisibility);
\r
48 public void init(IWorkbench workbench) {
\r