Project

General

Profile

Download (2.74 KB) Statistics
| Branch: | Tag: | Revision:
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>
30
 * FeatureTreePreferences class.
31
 * </p>
32
 * 
33
 * @author n.hoffmann
34
 * @created Aug 5, 2010
35
 * @version 1.0
36
 */
37
public class FeatureTreePreferences extends PreferencePage implements
38
		IWorkbenchPreferencePage {
39

    
40
	/**
41
	 * <p>
42
	 * Constructor for FeatureTreePreferences.
43
	 * </p>
44
	 */
45
	public FeatureTreePreferences() {
46
	}
47

    
48
	/**
49
	 * <p>
50
	 * Constructor for FeatureTreePreferences.
51
	 * </p>
52
	 * 
53
	 * @param title
54
	 *            a {@link java.lang.String} object.
55
	 */
56
	public FeatureTreePreferences(String title) {
57
		super(title);
58
	}
59

    
60
	/**
61
	 * <p>
62
	 * Constructor for FeatureTreePreferences.
63
	 * </p>
64
	 * 
65
	 * @param title
66
	 *            a {@link java.lang.String} object.
67
	 * @param image
68
	 *            a {@link org.eclipse.jface.resource.ImageDescriptor} object.
69
	 */
70
	public FeatureTreePreferences(String title, ImageDescriptor image) {
71
		super(title, image);
72
	}
73

    
74
	/*
75
	 * (non-Javadoc)
76
	 * 
77
	 * @see
78
	 * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
79
	 */
80
	/** {@inheritDoc} */
81
	@Override
82
	public void init(IWorkbench workbench) {
83
	}
84

    
85
	/*
86
	 * (non-Javadoc)
87
	 * 
88
	 * @see
89
	 * org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse
90
	 * .swt.widgets.Composite)
91
	 */
92
	/** {@inheritDoc} */
93
	@Override
94
	protected Control createContents(Composite parent) {
95

    
96
		Composite composite = new Composite(parent, SWT.NULL);
97
		composite.setLayout(new GridLayout());
98

    
99
		final Button button_openFeatureTree = new Button(composite, SWT.PUSH);
100
		button_openFeatureTree.setText("Open FeatureTree Editor");
101

    
102
		button_openFeatureTree.addSelectionListener(new SelectionAdapter() {
103
			@Override
104
			public void widgetSelected(SelectionEvent e) {
105
				FeatureTreeEditorWizard featureTreeEditorDialog = new FeatureTreeEditorWizard();
106
				WizardDialog dialog = new WizardDialog(getShell(),
107
						featureTreeEditorDialog);
108

    
109
				dialog.open();
110
			}
111
		});
112

    
113
		return composite;
114
	}
115
}
(4-4/15)