Refactoring of selection elements. Additional minor refactoring. Fixed a bug with...
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / AbstractEntityCollectionElement.java
index 9788296a805153ae6d367c632764ecf5012b3472..ca1353b2c53d0de4301743261bc778221977301e 100644 (file)
@@ -17,7 +17,6 @@ import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Layout;
 import org.eclipse.ui.forms.widgets.TableWrapLayout;
 
@@ -31,6 +30,7 @@ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.IEntityElement;
 import eu.etaxonomy.taxeditor.ui.element.ISelectable;
+import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
 
 /**
  * <p>
@@ -90,12 +90,12 @@ public abstract class AbstractEntityCollectionElement<ENTITY> extends
                box.setBackgroundMode(SWT.INHERIT_DEFAULT);
                addControl(box);
 
-               TableWrapLayout boxLayout = CdmFormFactory.LAYOUT(2, false);
+               TableWrapLayout boxLayout = LayoutConstants.LAYOUT(2, false);
                boxLayout.topMargin = 4;
                boxLayout.bottomMargin = 4;
                box.setLayout(boxLayout);
 
-               box.setLayoutData(CdmFormFactory.FILL_HORIZONTALLY());
+               box.setLayoutData(LayoutConstants.FILL_HORIZONTALLY());
 
                // box.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
 
@@ -106,15 +106,15 @@ public abstract class AbstractEntityCollectionElement<ENTITY> extends
                setLayoutComposite(container);
 
                addControl(container);
-               Layout containerLayout = CdmFormFactory.LAYOUT(2, false);
+               Layout containerLayout = LayoutConstants.LAYOUT(2, false);
 
                container.setLayout(containerLayout);
-               container.setLayoutData(CdmFormFactory.FILL_HORIZONTALLY());
+               container.setLayoutData(LayoutConstants.FILL_HORIZONTALLY());
 
                if (removeListener != null) {
                        button_remove = formFactory.createButton(box, null, SWT.PUSH);
                        addControl(button_remove);
-                       button_remove.setLayoutData(CdmFormFactory.RIGHT());
+                       button_remove.setLayoutData(LayoutConstants.RIGHT());
                        button_remove.setImage(ImageResources
                                        .getImage(ImageResources.TRASH_ICON));
                        button_remove.setToolTipText("Remove");