246780abf85594b53934e92db463a642fb0f5376
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / preference / FeatureTreePreferences.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9
10 package eu.etaxonomy.taxeditor.preference;
11
12 import org.eclipse.jface.resource.ImageDescriptor;
13 import org.eclipse.swt.SWT;
14 import org.eclipse.swt.layout.GridLayout;
15 import org.eclipse.swt.widgets.Composite;
16 import org.eclipse.swt.widgets.Control;
17 import org.eclipse.ui.IWorkbench;
18 import org.eclipse.ui.IWorkbenchPreferencePage;
19
20 import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage;
21 import eu.etaxonomy.taxeditor.store.CdmStore;
22 import eu.etaxonomy.taxeditor.ui.element.CommandHandlerButton;
23
24 /**
25 * <p>
26 * FeatureTreePreferences class.
27 * </p>
28 *
29 * @author n.hoffmann
30 * @created Aug 5, 2010
31 * @version 1.0
32 */
33 public class FeatureTreePreferences extends CdmPreferencePage implements
34 IWorkbenchPreferencePage {
35
36 /**
37 * <p>
38 * Constructor for FeatureTreePreferences.
39 * </p>
40 */
41 public FeatureTreePreferences() {
42 }
43
44 /**
45 * <p>
46 * Constructor for FeatureTreePreferences.
47 * </p>
48 *
49 * @param title
50 * a {@link java.lang.String} object.
51 */
52 public FeatureTreePreferences(String title) {
53 super(title);
54 }
55
56 /**
57 * <p>
58 * Constructor for FeatureTreePreferences.
59 * </p>
60 *
61 * @param title
62 * a {@link java.lang.String} object.
63 * @param image
64 * a {@link org.eclipse.jface.resource.ImageDescriptor} object.
65 */
66 public FeatureTreePreferences(String title, ImageDescriptor image) {
67 super(title, image);
68 }
69
70 /*
71 * (non-Javadoc)
72 *
73 * @see
74 * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
75 */
76 /** {@inheritDoc} */
77 @Override
78 public void init(IWorkbench workbench) {
79 }
80
81 /*
82 * (non-Javadoc)
83 *
84 * @see
85 * org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse
86 * .swt.widgets.Composite)
87 */
88 /** {@inheritDoc} */
89 @Override
90 protected Control createContents(Composite parent) {
91 Composite composite = new Composite(parent, SWT.NULL);
92 composite.setLayout(new GridLayout());
93
94 final CommandHandlerButton button_openFeatureTree = new CommandHandlerButton(composite, SWT.PUSH, "eu.etaxonomy.taxeditor.store.open.FeatureTreeEditorWizard");
95 button_openFeatureTree.setText("Open FeatureTree Editor");
96 PreferencesUtil.recursiveSetEnabled(composite, CdmStore.isActive());
97 return composite;
98 }
99 }