1 /*******************************************************************************
\r
2 * Copyright (c) 2012, 2013 Association for Decentralized Information Management in
\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
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.g3d.vtk.preferences;
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;
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.
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.
33 public class VTKPreferencePage
34 extends FieldEditorPreferencePage
35 implements IWorkbenchPreferencePage {
37 public VTKPreferencePage() {
39 setPreferenceStore(Activator.getDefault().getPreferenceStore());
40 setDescription("VTK Preferences (DEBUG)");
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
49 public void createFieldEditors() {
50 addField(new RadioGroupFieldEditor(
51 PreferenceConstants.CLOSE_METHOD,
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()));
62 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
64 public void init(IWorkbench workbench) {