// $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.
*/
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;
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.model.ImageResources;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
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>
* Abstract AbstractEntityCollectionElement class.
* </p>
- *
+ *
* @author n.hoffmann
* @created Nov 16, 2009
* @version 1.0
protected ENTITY entity;
- private Composite container;
+ private final Composite container;
- private Composite box;
+ private final Composite box;
private Button button_remove;
* <p>
* Constructor for AbstractEntityCollectionElement.
* </p>
- *
+ *
* @param style
* a int.
* @param formFactory
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));
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");
/**
* Init gets executed before any other setup of the section takes place
- *
+ *
* Implement this if you want to configure the section
*/
public void init() {
* <p>
* Setter for the field <code>entity</code>.
* </p>
- *
+ *
* @param entity
* a ENTITY object.
*/
* <p>
* Getter for the field <code>entity</code>.
* </p>
- *
+ *
* @return a ENTITY object.
*/
- public ENTITY getEntity() {
+ @Override
+ public ENTITY getEntity() {
return entity;
}
* <p>
* createControls
* </p>
- *
+ *
* @param element
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
/**
* 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) {
/*
* (non-Javadoc)
- *
+ *
* @see
* eu.etaxonomy.taxeditor.forms.AbstractCdmFormElement#propertyChange(org
* .eclipse.jface.util.PropertyChangeEvent)
* <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);
/**
* {@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} */
* <p>
* Getter for the field <code>backgroundColor</code>.
* </p>
- *
+ *
* @return the backgroundColor
*/
public Color getBackgroundColor() {
* <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();
}
/** {@inheritDoc} */
- public void update(CdmDataChangeMap changeEvents) {
+ @Override
+ public void update(CdmDataChangeMap changeEvents) {
}
}