+// $Id$
+/**
+* Copyright (C) 2016 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.ui;
+
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
+import eu.etaxonomy.taxeditor.ui.element.RootElement;
+
+/**
+ * @author pplitzner
+ * @date Mar 30, 2016
+ *
+ */
+public abstract class AbstractEntityCollectionElementWizardPage extends WizardPage implements
+IPropertyChangeListener {
+
+ protected CdmFormFactory formFactory;
+
+ protected RootElement rootElement;
+
+ protected AbstractEntityCollectionElementWizardPage(String pageName) {
+ super(pageName);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void createControl(Composite parent) {
+ this.setPageComplete(false);
+
+ Composite control = formFactory.createComposite(parent);
+
+ TableWrapLayout layout = LayoutConstants.LAYOUT(2, false);
+ layout.horizontalSpacing = 5;
+ control.setLayout(layout);
+
+ rootElement = new RootElement(formFactory, control);
+
+
+ setControl(control);
+
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void dispose() {
+ rootElement.removeElements();
+ formFactory.removePropertyChangeListener(this);
+ super.dispose();
+ }
+
+}