Fix ticket #4367
[taxeditor.git] / eu.etaxonomy.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.swt.SWT;
16 import org.eclipse.swt.layout.GridLayout;
17 import org.eclipse.swt.widgets.Composite;
18 import org.eclipse.swt.widgets.Control;
19 import org.eclipse.ui.IWorkbench;
20 import org.eclipse.ui.IWorkbenchPreferencePage;
21
22 import eu.etaxonomy.taxeditor.store.CdmStore;
23 import eu.etaxonomy.taxeditor.ui.element.CommandHandlerButton;
24
25 /**
26 * <p>
27 * FeatureTreePreferences class.
28 * </p>
29 *
30 * @author n.hoffmann
31 * @created Aug 5, 2010
32 * @version 1.0
33 */
34 public class FeatureTreePreferences extends PreferencePage implements
35 IWorkbenchPreferencePage {
36
37 /**
38 * <p>
39 * Constructor for FeatureTreePreferences.
40 * </p>
41 */
42 public FeatureTreePreferences() {
43 }
44
45 /**
46 * <p>
47 * Constructor for FeatureTreePreferences.
48 * </p>
49 *
50 * @param title
51 * a {@link java.lang.String} object.
52 */
53 public FeatureTreePreferences(String title) {
54 super(title);
55 }
56
57 /**
58 * <p>
59 * Constructor for FeatureTreePreferences.
60 * </p>
61 *
62 * @param title
63 * a {@link java.lang.String} object.
64 * @param image
65 * a {@link org.eclipse.jface.resource.ImageDescriptor} object.
66 */
67 public FeatureTreePreferences(String title, ImageDescriptor image) {
68 super(title, image);
69 }
70
71 /*
72 * (non-Javadoc)
73 *
74 * @see
75 * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
76 */
77 /** {@inheritDoc} */
78 @Override
79 public void init(IWorkbench workbench) {
80 }
81
82 /*
83 * (non-Javadoc)
84 *
85 * @see
86 * org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse
87 * .swt.widgets.Composite)
88 */
89 /** {@inheritDoc} */
90 @Override
91 protected Control createContents(Composite parent) {
92 Composite composite = new Composite(parent, SWT.NULL);
93 composite.setLayout(new GridLayout());
94
95 final CommandHandlerButton button_openFeatureTree = new CommandHandlerButton(composite, SWT.PUSH, "eu.etaxonomy.taxeditor.store.open.FeatureTreeEditorWizard");
96 button_openFeatureTree.setText("Open FeatureTree Editor");
97 PreferencesUtil.recursiveSetEnabled(composite, CdmStore.isActive());
98 return composite;
99 }
100 }