Project

General

Profile

Download (2.79 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>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
		// TODO Auto-generated constructor stub
43
	}
44

    
45
	/**
46
	 * <p>Constructor for FeatureTreePreferences.</p>
47
	 *
48
	 * @param title a {@link java.lang.String} object.
49
	 */
50
	public FeatureTreePreferences(String title) {
51
		super(title);
52
		// TODO Auto-generated constructor stub
53
	}
54

    
55
	/**
56
	 * <p>Constructor for FeatureTreePreferences.</p>
57
	 *
58
	 * @param title a {@link java.lang.String} object.
59
	 * @param image a {@link org.eclipse.jface.resource.ImageDescriptor} object.
60
	 */
61
	public FeatureTreePreferences(String title, ImageDescriptor image) {
62
		super(title, image);
63
		// TODO Auto-generated constructor stub
64
	}
65

    
66
	/* (non-Javadoc)
67
	 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
68
	 */
69
	/** {@inheritDoc} */
70
	@Override
71
	public void init(IWorkbench workbench) {
72
		// TODO Auto-generated method stub
73

    
74
	}
75

    
76
	/* (non-Javadoc)
77
	 * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
78
	 */
79
	/** {@inheritDoc} */
80
	@Override
81
	protected Control createContents(Composite parent) {
82
		
83
		Composite composite = new Composite(parent, SWT.NULL);
84
		composite.setLayout(new GridLayout());
85
		
86
		final Button button_openFeatureTree = new Button(composite, SWT.PUSH);
87
		button_openFeatureTree.setText("Open FeatureTree Editor");
88
		
89
		button_openFeatureTree.addSelectionListener(new SelectionAdapter() {
90
			@Override
91
			public void widgetSelected(SelectionEvent e) {
92
				FeatureTreeEditorWizard featureTreeEditorDialog = new FeatureTreeEditorWizard();
93
				WizardDialog dialog = new WizardDialog(getShell(), featureTreeEditorDialog);
94
				
95
				dialog.open();
96
			}
97
		});
98
		
99
		return composite;
100
	}
101
}
(4-4/13)