ref #6925 Set conversation and cdmEntitySession to null for dispose
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / AbstractEntityCollectionElementWizardPage.java
1 /**
2 * Copyright (C) 2016 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 package eu.etaxonomy.taxeditor.ui;
10
11 import org.eclipse.jface.util.IPropertyChangeListener;
12 import org.eclipse.jface.wizard.WizardPage;
13 import org.eclipse.swt.widgets.Composite;
14 import org.eclipse.ui.forms.widgets.TableWrapLayout;
15
16 import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
17 import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
18 import eu.etaxonomy.taxeditor.store.CdmStore;
19 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
20 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
21 import eu.etaxonomy.taxeditor.ui.element.RootElement;
22 import eu.etaxonomy.taxeditor.webapp.ICDMServerError;
23
24 /**
25 * @author pplitzner
26 * @date Mar 30, 2016
27 *
28 */
29 public abstract class AbstractEntityCollectionElementWizardPage extends WizardPage implements
30 IPropertyChangeListener {
31
32 protected CdmFormFactory formFactory;
33
34
35 protected RootElement rootElement;
36
37 protected AbstractEntityCollectionElementWizardPage(String pageName) {
38 super(pageName);
39
40 }
41
42 /**
43 * {@inheritDoc}
44 */
45 @Override
46 public void createControl(Composite parent) {
47 this.setPageComplete(false);
48
49 Composite control = formFactory.createComposite(parent);
50
51 TableWrapLayout layout = LayoutConstants.LAYOUT(2, false);
52 layout.horizontalSpacing = 5;
53 control.setLayout(layout);
54
55 rootElement = new RootElement(formFactory, control);
56
57
58 setControl(control);
59
60 }
61
62 /** {@inheritDoc} */
63 @Override
64 public void dispose() {
65 rootElement.removeElements();
66 formFactory.removePropertyChangeListener(this);
67
68 super.dispose();
69 }
70
71 }