- adapted EntitiySelectionElement to be able to use with WindowBuilder
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / AbstractEntityCollectionElement.java
index ca1353b2c53d0de4301743261bc778221977301e..0465b70eca537cfc6200b8e91eed808cb7d0afeb 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * 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.
  */
@@ -36,7 +36,7 @@ import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
  * <p>
  * Abstract AbstractEntityCollectionElement class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created Nov 16, 2009
  * @version 1.0
@@ -47,9 +47,9 @@ public abstract class AbstractEntityCollectionElement<ENTITY> extends
 
        protected ENTITY entity;
 
-       private Composite container;
+       private final Composite container;
 
-       private Composite box;
+       private final Composite box;
 
        private Button button_remove;
 
@@ -59,7 +59,7 @@ public abstract class AbstractEntityCollectionElement<ENTITY> extends
         * <p>
         * Constructor for AbstractEntityCollectionElement.
         * </p>
-        * 
+        *
         * @param style
         *            a int.
         * @param formFactory
@@ -129,7 +129,7 @@ public abstract class AbstractEntityCollectionElement<ENTITY> extends
 
        /**
         * Init gets executed before any other setup of the section takes place
-        * 
+        *
         * Implement this if you want to configure the section
         */
        public void init() {
@@ -140,7 +140,7 @@ public abstract class AbstractEntityCollectionElement<ENTITY> extends
         * <p>
         * Setter for the field <code>entity</code>.
         * </p>
-        * 
+        *
         * @param entity
         *            a ENTITY object.
         */
@@ -150,10 +150,11 @@ public abstract class AbstractEntityCollectionElement<ENTITY> extends
         * <p>
         * Getter for the field <code>entity</code>.
         * </p>
-        * 
+        *
         * @return a ENTITY object.
         */
-       public ENTITY getEntity() {
+       @Override
+    public ENTITY getEntity() {
                return entity;
        }
 
@@ -161,7 +162,7 @@ public abstract class AbstractEntityCollectionElement<ENTITY> extends
         * <p>
         * createControls
         * </p>
-        * 
+        *
         * @param element
         *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
         *            object.
@@ -173,7 +174,8 @@ public abstract class AbstractEntityCollectionElement<ENTITY> extends
        /**
         * Mark <code>this</code> element as selected.
         */
-       public void setSelected(boolean selected) {
+       @Override
+    public void setSelected(boolean selected) {
 
                for (ICdmFormElement element : getElements()) {
                        if (element instanceof ISelectable) {
@@ -185,7 +187,7 @@ public abstract class AbstractEntityCollectionElement<ENTITY> extends
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.forms.AbstractCdmFormElement#propertyChange(org
         * .eclipse.jface.util.PropertyChangeEvent)
@@ -206,14 +208,15 @@ public abstract class AbstractEntityCollectionElement<ENTITY> extends
         * <p>
         * handleEvent
         * </p>
-        * 
+        *
         * @param eventSource
         *            a {@link java.lang.Object} object.
         */
        public abstract void handleEvent(Object eventSource);
 
        /** {@inheritDoc} */
-       public void setBackground(Color color) {
+       @Override
+    public void setBackground(Color color) {
                backgroundColor = color;
                super.setBackground(color);
                box.setBackground(color);
@@ -222,15 +225,17 @@ public abstract class AbstractEntityCollectionElement<ENTITY> extends
 
        /**
         * {@inheritDoc}
-        * 
+        *
         * React when selection occurs
         */
-       public void widgetSelected(SelectionEvent e) {
+       @Override
+    public void widgetSelected(SelectionEvent e) {
 
        }
 
        /** {@inheritDoc} */
-       public void widgetDefaultSelected(SelectionEvent e) {
+       @Override
+    public void widgetDefaultSelected(SelectionEvent e) {
        }
 
        /** {@inheritDoc} */
@@ -243,7 +248,7 @@ public abstract class AbstractEntityCollectionElement<ENTITY> extends
         * <p>
         * Getter for the field <code>backgroundColor</code>.
         * </p>
-        * 
+        *
         * @return the backgroundColor
         */
        public Color getBackgroundColor() {
@@ -254,11 +259,12 @@ public abstract class AbstractEntityCollectionElement<ENTITY> extends
         * <p>
         * getConversationHolder
         * </p>
-        * 
+        *
         * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
         *         object.
         */
-       public ConversationHolder getConversationHolder() {
+       @Override
+    public ConversationHolder getConversationHolder() {
                if (getParentElement() instanceof IConversationEnabled) {
                        return ((IConversationEnabled) getParentElement())
                                        .getConversationHolder();
@@ -268,6 +274,7 @@ public abstract class AbstractEntityCollectionElement<ENTITY> extends
        }
 
        /** {@inheritDoc} */
-       public void update(CdmDataChangeMap changeEvents) {
+       @Override
+    public void update(CdmDataChangeMap changeEvents) {
        }
 }