2 * Copyright (C) 2017 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
9 package eu
.etaxonomy
.taxeditor
.databaseAdmin
.wizard
;
11 import org
.eclipse
.jface
.wizard
.WizardPage
;
12 import org
.eclipse
.swt
.SWT
;
13 import org
.eclipse
.swt
.layout
.GridData
;
14 import org
.eclipse
.swt
.layout
.GridLayout
;
15 import org
.eclipse
.swt
.widgets
.Composite
;
16 import org
.eclipse
.swt
.widgets
.TabFolder
;
17 import org
.eclipse
.swt
.widgets
.TabItem
;
24 public abstract class AbstractPreferenceWizard
extends WizardPage
{
28 protected AbstractPreferenceWizard(String pageName
) {
32 protected TabFolder tabFolder
;
33 protected Composite composite
;
35 * Adds a tab to the page.
36 * @param text the tab label
38 public Composite
addTab(String text
) {
39 if (tabFolder
== null){
40 // initialize tab folder
41 if (composite
== null) {
42 composite
= new Composite(getShell(), SWT
.NONE
);
44 tabFolder
= new TabFolder(composite
, SWT
.NONE
);
45 tabFolder
.setLayoutData(new GridData(GridData
.FILL_BOTH
));
48 TabItem item
= new TabItem(tabFolder
, SWT
.NONE
);
51 Composite currentTab
= new Composite(tabFolder
, SWT
.NULL
);
52 GridLayout layout
= new GridLayout();
53 currentTab
.setLayout(layout
);
54 currentTab
.setFont(composite
.getFont());
55 // currentTab.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
57 item
.setControl(currentTab
);