2 * Copyright (C) 2015 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
.ui
.dialog
.configurator
;
11 import org
.eclipse
.swt
.SWT
;
12 import org
.eclipse
.swt
.events
.DisposeEvent
;
13 import org
.eclipse
.swt
.events
.DisposeListener
;
14 import org
.eclipse
.swt
.layout
.FillLayout
;
15 import org
.eclipse
.swt
.widgets
.Composite
;
16 import org
.eclipse
.swt
.widgets
.Display
;
17 import org
.eclipse
.ui
.forms
.events
.ExpansionEvent
;
18 import org
.eclipse
.ui
.forms
.events
.IExpansionListener
;
19 import org
.eclipse
.ui
.forms
.widgets
.FormToolkit
;
20 import org
.eclipse
.ui
.forms
.widgets
.Section
;
22 import eu
.etaxonomy
.taxeditor
.l10n
.Messages
;
29 public class ConfiguratorComposite
extends Composite
implements IExpansionListener
{
31 private final FormToolkit toolkit
= new FormToolkit(Display
.getCurrent());
32 private final Section sctnConfigure
;
34 * Create the composite.
38 public ConfiguratorComposite(final Composite parent
, int style
) {
39 super(parent
, SWT
.NONE
);
41 addDisposeListener(new DisposeListener() {
43 public void widgetDisposed(DisposeEvent e
) {
47 toolkit
.paintBordersFor(this);
48 setLayout(new FillLayout(SWT
.HORIZONTAL
));
50 sctnConfigure
= toolkit
.createSection(this, Section
.CLIENT_INDENT
| Section
.TWISTIE
);
51 sctnConfigure
.addExpansionListener(this);
52 sctnConfigure
.setBackground(getBackground());
53 toolkit
.paintBordersFor(sctnConfigure
);
54 sctnConfigure
.setText(Messages
.ConfiguratorComposite_CONFIGURE
);
60 public void addConfiguratorComposite(Composite configuratorComposite
){
61 toolkit
.paintBordersFor(configuratorComposite
);
62 sctnConfigure
.setClient(configuratorComposite
);
66 public void expansionStateChanged(ExpansionEvent e
) {
67 getShell().setSize(getShell().computeSize(SWT
.DEFAULT
, SWT
.DEFAULT
));
70 public void expansionStateChanging(ExpansionEvent e
) {
72 public Section
getSectionConfigure() {