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