fixes issues with named area selection dialog and custom areas; fixes #2265
[taxeditor.git] / taxeditor-store / src / main / java / eu / etaxonomy / taxeditor / ui / forms / AbstractCdmEntityWizardPage.java
index 21a205cd1631e1450960cb7ba3041b675de67fa4..78b3f900945174426ef7a78fb08d149d48a2561d 100644 (file)
 package eu.etaxonomy.taxeditor.ui.forms;
 
 import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
@@ -67,7 +71,12 @@ public abstract class AbstractCdmEntityWizardPage<T> extends WizardPage implemen
         */
        /** {@inheritDoc} */
        public void createControl(Composite parent) {
-               Composite control = formFactory.createComposite(parent);
+               ScrolledForm scrolledForm = formFactory.createScrolledForm(parent);
+               GridLayout layout = new GridLayout();           
+               scrolledForm.getBody().setLayout(layout);
+               
+               Composite control = formFactory.createComposite(scrolledForm.getBody());
+               control.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
                
                control.setLayout(CdmFormFactory.LAYOUT(2, false));
                WizardPageRootElement rootElement = new WizardPageRootElement(formFactory, control, getConversationHolder());
@@ -78,8 +87,9 @@ public abstract class AbstractCdmEntityWizardPage<T> extends WizardPage implemen
                
                rootElement.setBackground(bgColor);
                control.setBackground(bgColor);
+               scrolledForm.setBackground(bgColor);
                
-               setControl(control);
+               setControl(scrolledForm);
        }
        
        /**
@@ -97,7 +107,7 @@ public abstract class AbstractCdmEntityWizardPage<T> extends WizardPage implemen
         * @param rootElement a {@link eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement} object.
         * @return a {@link eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement} object.
         */
-       public abstract AbstractCdmDetailElement createElement(ICdmFormElement rootElement);
+       public abstract AbstractCdmDetailElement<T> createElement(ICdmFormElement rootElement);
        
        private class WizardPageRootElement extends RootElement implements IConversationEnabled{