]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/preferences/IssuePreferencePage.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.issues.ui / src / org / simantics / issues / ui / preferences / IssuePreferencePage.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2011 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
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.issues.ui.preferences;\r
13 \r
14 import org.eclipse.core.runtime.preferences.InstanceScope;\r
15 import org.eclipse.jface.preference.FieldEditorPreferencePage;\r
16 import org.eclipse.jface.preference.IPreferenceStore;\r
17 import org.eclipse.jface.preference.IntegerFieldEditor;\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.issues.preferences.IssuePreferences;\r
22 \r
23 public class IssuePreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {\r
24 \r
25     public IssuePreferencePage() {\r
26         super(GRID);\r
27     }\r
28 \r
29     @Override\r
30     public void init(IWorkbench workbench) {\r
31     }\r
32 \r
33     @Override\r
34     protected IPreferenceStore doGetPreferenceStore() {\r
35         return new ScopedPreferenceStore(InstanceScope.INSTANCE, "org.simantics.issues");\r
36     }\r
37 \r
38     @Override\r
39     protected void createFieldEditors() {\r
40         //addField(new BooleanFieldEditor(IssuePreferences.P_ISSUES_ENABLED, "Issue searching &enabled (only takes effect after restart)", getFieldEditorParent()));\r
41         IntegerFieldEditor f = new IntegerFieldEditor(IssuePreferences.P_MAX_BATCH_ISSUES_TO_WRITE, "Maximum batch validation issues to write", getFieldEditorParent());\r
42         f.getLabelControl(getFieldEditorParent()).setToolTipText("Limit for amount of batch validation issue results to write into the database");\r
43         addField(f);\r
44     }\r
45 \r
46 }\r