]> gerrit.simantics Code Review - simantics/3d.git/blob - org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/preferences/VTKPreferencePage.java
White space clean-up
[simantics/3d.git] / org.simantics.g3d.vtk / src / org / simantics / g3d / vtk / preferences / VTKPreferencePage.java
1 /*******************************************************************************\r
2  * Copyright (c) 2012, 2013 Association for Decentralized Information Management in\r
3  * 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.g3d.vtk.preferences;
13
14 import org.eclipse.jface.preference.*;
15 import org.eclipse.ui.IWorkbenchPreferencePage;
16 import org.eclipse.ui.IWorkbench;
17 import org.simantics.g3d.vtk.Activator;
18
19 /**
20  * This class represents a preference page that
21  * is contributed to the Preferences dialog. By 
22  * subclassing <samp>FieldEditorPreferencePage</samp>, we
23  * can use the field support built into JFace that allows
24  * us to create a page that is small and knows how to 
25  * save, restore and apply itself.
26  * <p>
27  * This page is used to modify preferences only. They
28  * are stored in the preference store that belongs to
29  * the main plug-in class. That way, preferences can
30  * be accessed directly via the preference store.
31  */
32
33 public class VTKPreferencePage
34         extends FieldEditorPreferencePage
35         implements IWorkbenchPreferencePage {
36
37         public VTKPreferencePage() {
38                 super(GRID);
39                 setPreferenceStore(Activator.getDefault().getPreferenceStore());
40                 setDescription("VTK Preferences (DEBUG)");
41         }
42         
43         /**
44          * Creates the field editors. Field editors are abstractions of
45          * the common GUI blocks needed to manipulate various types
46          * of preferences. Each field editor knows how to save and
47          * restore itself.
48          */
49         public void createFieldEditors() {
50                 addField(new RadioGroupFieldEditor(
51                                 PreferenceConstants.CLOSE_METHOD,
52                         "When to close VTK",
53                         1,
54                         new String[][] { { "On &Editor Close", CloseMethod.ON_CLOSE.toString() }, 
55                                          { "On &Last Editor Close", CloseMethod.ON_LAST_CLOSE.toString() },
56                                          { "&Closing Disabled", CloseMethod.NO_CLOSE.toString() }
57                 }, getFieldEditorParent()));
58                 
59         }
60
61         /* (non-Javadoc)
62          * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
63          */
64         public void init(IWorkbench workbench) {
65         }
66         
67 }