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