]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.workbench/src/org/simantics/workbench/internal/preferences/ModelBrowserPreferencePage.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.workbench / src / org / simantics / workbench / internal / preferences / ModelBrowserPreferencePage.java
diff --git a/bundles/org.simantics.workbench/src/org/simantics/workbench/internal/preferences/ModelBrowserPreferencePage.java b/bundles/org.simantics.workbench/src/org/simantics/workbench/internal/preferences/ModelBrowserPreferencePage.java
new file mode 100644 (file)
index 0000000..8165196
--- /dev/null
@@ -0,0 +1,51 @@
+/*******************************************************************************\r
+ * Copyright (c) 2012 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     Semantum Oy - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.workbench.internal.preferences;\r
+\r
+import org.eclipse.core.runtime.preferences.InstanceScope;\r
+import org.eclipse.jface.preference.ComboFieldEditor;\r
+import org.eclipse.jface.preference.FieldEditorPreferencePage;\r
+import org.eclipse.jface.preference.IPreferenceStore;\r
+import org.eclipse.ui.IWorkbench;\r
+import org.eclipse.ui.IWorkbenchPreferencePage;\r
+import org.eclipse.ui.preferences.ScopedPreferenceStore;\r
+import org.simantics.ModelBrowserPreferences;\r
+\r
+/**\r
+ * @author Antti Villberg <antti.villberg@semantum.fi>\r
+ */\r
+public class ModelBrowserPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {\r
+\r
+    public ModelBrowserPreferencePage() {\r
+        super(GRID);\r
+        IPreferenceStore pf = new ScopedPreferenceStore(InstanceScope.INSTANCE, ModelBrowserPreferences.P_NODE);\r
+        setPreferenceStore( pf );\r
+    }\r
+\r
+    @Override\r
+    protected void createFieldEditors() {\r
+       \r
+       String[][] namesAndValues = {\r
+                       new String[] { "Shared Ontologies", ModelBrowserPreferences.ONTOLOGY_VISIBILITY_SHARED },\r
+                       new String[] { "All Ontologies", ModelBrowserPreferences.ONTOLOGY_VISIBILITY_ALL }\r
+       };\r
+       \r
+       ComboFieldEditor ontologyVisibility = new ComboFieldEditor(ModelBrowserPreferences.P_ONTOLOGY_VISIBILITY, "Ontology Visibility", namesAndValues, getFieldEditorParent());\r
+        addField(ontologyVisibility);\r
+\r
+    }\r
+\r
+       @Override\r
+       public void init(IWorkbench workbench) {\r
+       }\r
+\r
+}\r