3 * Copyright (C) 2015 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.taxeditor
.ui
.dialog
.deleteConfigurator
;
12 import org
.eclipse
.swt
.SWT
;
13 import org
.eclipse
.swt
.events
.DisposeEvent
;
14 import org
.eclipse
.swt
.events
.DisposeListener
;
15 import org
.eclipse
.swt
.layout
.FillLayout
;
16 import org
.eclipse
.swt
.widgets
.Composite
;
17 import org
.eclipse
.swt
.widgets
.Display
;
18 import org
.eclipse
.ui
.forms
.events
.ExpansionEvent
;
19 import org
.eclipse
.ui
.forms
.events
.IExpansionListener
;
20 import org
.eclipse
.ui
.forms
.widgets
.FormToolkit
;
21 import org
.eclipse
.ui
.forms
.widgets
.Section
;
28 public class DeleteConfiguratorComposite
extends Composite
implements IExpansionListener
{
30 private final FormToolkit toolkit
= new FormToolkit(Display
.getCurrent());
31 private final Section sctnConfigure
;
33 * Create the composite.
37 public DeleteConfiguratorComposite(final Composite parent
, int style
) {
38 super(parent
, SWT
.NONE
);
40 addDisposeListener(new DisposeListener() {
42 public void widgetDisposed(DisposeEvent e
) {
46 toolkit
.paintBordersFor(this);
47 setLayout(new FillLayout(SWT
.HORIZONTAL
));
49 sctnConfigure
= toolkit
.createSection(this, Section
.CLIENT_INDENT
| Section
.TWISTIE
);
50 sctnConfigure
.addExpansionListener(this);
51 sctnConfigure
.setBackground(getBackground());
52 toolkit
.paintBordersFor(sctnConfigure
);
53 sctnConfigure
.setText("Configure");
59 public void addConfiguratorComposite(Composite configuratorComposite
){
60 toolkit
.paintBordersFor(configuratorComposite
);
61 sctnConfigure
.setClient(configuratorComposite
);
65 public void expansionStateChanged(ExpansionEvent e
) {
66 getShell().setSize(getShell().computeSize(SWT
.DEFAULT
, SWT
.DEFAULT
));
69 public void expansionStateChanging(ExpansionEvent e
) {
71 public Section
getSectionConfigure() {