3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
11 package eu
.etaxonomy
.taxeditor
.preference
;
13 import org
.eclipse
.jface
.preference
.PreferencePage
;
14 import org
.eclipse
.jface
.resource
.ImageDescriptor
;
15 import org
.eclipse
.jface
.wizard
.WizardDialog
;
16 import org
.eclipse
.swt
.SWT
;
17 import org
.eclipse
.swt
.events
.SelectionAdapter
;
18 import org
.eclipse
.swt
.events
.SelectionEvent
;
19 import org
.eclipse
.swt
.layout
.GridLayout
;
20 import org
.eclipse
.swt
.widgets
.Button
;
21 import org
.eclipse
.swt
.widgets
.Composite
;
22 import org
.eclipse
.swt
.widgets
.Control
;
23 import org
.eclipse
.ui
.IWorkbench
;
24 import org
.eclipse
.ui
.IWorkbenchPreferencePage
;
26 import eu
.etaxonomy
.taxeditor
.featuretree
.FeatureTreeEditorWizard
;
29 * <p>FeatureTreePreferences class.</p>
32 * @created Aug 5, 2010
35 public class FeatureTreePreferences
extends PreferencePage
implements
36 IWorkbenchPreferencePage
{
39 * <p>Constructor for FeatureTreePreferences.</p>
41 public FeatureTreePreferences() {
45 * <p>Constructor for FeatureTreePreferences.</p>
47 * @param title a {@link java.lang.String} object.
49 public FeatureTreePreferences(String title
) {
54 * <p>Constructor for FeatureTreePreferences.</p>
56 * @param title a {@link java.lang.String} object.
57 * @param image a {@link org.eclipse.jface.resource.ImageDescriptor} object.
59 public FeatureTreePreferences(String title
, ImageDescriptor image
) {
64 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
68 public void init(IWorkbench workbench
) {
72 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
76 protected Control
createContents(Composite parent
) {
78 Composite composite
= new Composite(parent
, SWT
.NULL
);
79 composite
.setLayout(new GridLayout());
81 final Button button_openFeatureTree
= new Button(composite
, SWT
.PUSH
);
82 button_openFeatureTree
.setText("Open FeatureTree Editor");
84 button_openFeatureTree
.addSelectionListener(new SelectionAdapter() {
86 public void widgetSelected(SelectionEvent e
) {
87 FeatureTreeEditorWizard featureTreeEditorDialog
= new FeatureTreeEditorWizard();
88 WizardDialog dialog
= new WizardDialog(getShell(), featureTreeEditorDialog
);