public abstract class AbstractEntityCollectionElement<ENTITY> extends AbstractCdmFormElement implements IEntityElement<ENTITY>, org.eclipse.swt.events.SelectionListener, eu.etaxonomy.cdm.api.conversation.IConversationEnabled
AbstractEntityCollectionSection
and links listener functionalities to it.Modifier and Type | Field and Description |
---|---|
protected org.eclipse.swt.widgets.Button |
btnChooseEntity |
protected ENTITY |
entity |
formFactory
NOT_SELECTED, SELECTED
Constructor and Description |
---|
AbstractEntityCollectionElement(CdmFormFactory formFactory,
AbstractFormSection section,
ENTITY entity,
org.eclipse.swt.events.SelectionListener removeListener,
org.eclipse.swt.graphics.Color backgroundColor,
int style) |
Modifier and Type | Method and Description |
---|---|
abstract void |
createControls(ICdmFormElement element,
int style) |
org.eclipse.swt.graphics.Color |
getBackgroundColor() |
org.eclipse.swt.widgets.Composite |
getBox() |
eu.etaxonomy.cdm.api.conversation.ConversationHolder |
getConversationHolder() |
ENTITY |
getEntity()
Returns the entity of this composite.
|
org.eclipse.swt.widgets.Composite |
getLayoutComposite()
Getter for the field
layoutComposite . |
abstract void |
handleEvent(java.lang.Object eventSource) |
void |
init()
Init gets executed before any other setup of the section takes place
Implement this if you want to configure the section
|
void |
propertyChange(org.eclipse.jface.util.PropertyChangeEvent event)
This method gets called whenever the toolkit this composite was created with gets a property change notification.
|
protected ENTITY |
selectFromDialog()
Sub classes should override to provide the functionality to choose the
entity from existing ones from the data source.
Note: to enable this functionality sub classes have to set the corresponding flag in the super constructor |
void |
setBackground(org.eclipse.swt.graphics.Color color)
setBackground
|
abstract void |
setEntity(ENTITY entity) |
void |
setSelected(boolean selected)
Mark
this element as selected. |
void |
update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap changeEvents) |
void |
widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e) |
void |
widgetSelected(org.eclipse.swt.events.SelectionEvent e)
React when selection occurs
|
addControl, addElement, containsFormElement, firePropertyChangeEvent, firePropertyChangeEvent, firePropertyChangeEvent, getColor, getControls, getElements, getFormFactory, getParentElement, getPersistentBackground, getPropertyChangeListeners, refresh, removeControl, removeElement, removeElements, removeElementsAndControls, setFocus, setLayoutComposite, setPersistentBackground, setPropertyChangeListeners
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addElement, containsFormElement, getControls, getElements, getFormFactory, getParentElement, getPersistentBackground, getPropertyChangeListeners, refresh, removeElements, setPersistentBackground, setPropertyChangeListeners
firePropertyChangeEvent
protected ENTITY entity
protected org.eclipse.swt.widgets.Button btnChooseEntity
public AbstractEntityCollectionElement(CdmFormFactory formFactory, AbstractFormSection section, ENTITY entity, org.eclipse.swt.events.SelectionListener removeListener, org.eclipse.swt.graphics.Color backgroundColor, int style)
public void init()
public abstract void setEntity(ENTITY entity)
public ENTITY getEntity()
IEntityElement
getEntity
in interface IEntityElement<ENTITY>
protected ENTITY selectFromDialog()
public abstract void createControls(ICdmFormElement element, int style)
public void setSelected(boolean selected)
this
element as selected.setSelected
in interface ISelectable
selected
- a boolean.public void propertyChange(org.eclipse.jface.util.PropertyChangeEvent event)
propertyChange
in interface org.eclipse.jface.util.IPropertyChangeListener
propertyChange
in class AbstractCdmFormElement
IPropertyChangeListener.propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
public abstract void handleEvent(java.lang.Object eventSource)
public void setBackground(org.eclipse.swt.graphics.Color color)
setBackground
setBackground
in interface ICdmFormElement
setBackground
in class AbstractCdmFormElement
color
- a Color
object.public void widgetSelected(org.eclipse.swt.events.SelectionEvent e)
widgetSelected
in interface org.eclipse.swt.events.SelectionListener
public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e)
widgetDefaultSelected
in interface org.eclipse.swt.events.SelectionListener
public org.eclipse.swt.widgets.Composite getLayoutComposite()
Getter for the field layoutComposite
.
getLayoutComposite
in interface ICdmFormElement
getLayoutComposite
in class AbstractCdmFormElement
Composite
object.public org.eclipse.swt.graphics.Color getBackgroundColor()
public org.eclipse.swt.widgets.Composite getBox()
public eu.etaxonomy.cdm.api.conversation.ConversationHolder getConversationHolder()
getConversationHolder
in interface eu.etaxonomy.cdm.api.conversation.IConversationEnabled
public void update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap changeEvents)
update
in interface eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver
Copyright © 2007-2018. All Rights Reserved.