automated build configuration is on its way
[taxeditor.git] / taxeditor-store / src / main / java / eu / etaxonomy / taxeditor / preference / FeatureTreePreferences.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
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.
9 */
10
11 package eu.etaxonomy.taxeditor.preference;
12
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;
25
26 import eu.etaxonomy.taxeditor.featuretree.FeatureTreeEditorWizard;
27
28 /**
29 * <p>FeatureTreePreferences class.</p>
30 *
31 * @author n.hoffmann
32 * @created Aug 5, 2010
33 * @version 1.0
34 */
35 public class FeatureTreePreferences extends PreferencePage implements
36 IWorkbenchPreferencePage {
37
38 /**
39 * <p>Constructor for FeatureTreePreferences.</p>
40 */
41 public FeatureTreePreferences() {
42 }
43
44 /**
45 * <p>Constructor for FeatureTreePreferences.</p>
46 *
47 * @param title a {@link java.lang.String} object.
48 */
49 public FeatureTreePreferences(String title) {
50 super(title);
51 }
52
53 /**
54 * <p>Constructor for FeatureTreePreferences.</p>
55 *
56 * @param title a {@link java.lang.String} object.
57 * @param image a {@link org.eclipse.jface.resource.ImageDescriptor} object.
58 */
59 public FeatureTreePreferences(String title, ImageDescriptor image) {
60 super(title, image);
61 }
62
63 /* (non-Javadoc)
64 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
65 */
66 /** {@inheritDoc} */
67 @Override
68 public void init(IWorkbench workbench) {
69 }
70
71 /* (non-Javadoc)
72 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
73 */
74 /** {@inheritDoc} */
75 @Override
76 protected Control createContents(Composite parent) {
77
78 Composite composite = new Composite(parent, SWT.NULL);
79 composite.setLayout(new GridLayout());
80
81 final Button button_openFeatureTree = new Button(composite, SWT.PUSH);
82 button_openFeatureTree.setText("Open FeatureTree Editor");
83
84 button_openFeatureTree.addSelectionListener(new SelectionAdapter() {
85 @Override
86 public void widgetSelected(SelectionEvent e) {
87 FeatureTreeEditorWizard featureTreeEditorDialog = new FeatureTreeEditorWizard();
88 WizardDialog dialog = new WizardDialog(getShell(), featureTreeEditorDialog);
89
90 dialog.open();
91 }
92 });
93
94 return composite;
95 }
96 }