ENTITY
- A CDM entity which should be visualized by this section.ELEMENT
- An element that can be added (multiple times) to this entity.public abstract class AbstractEntityCollectionSection<ENTITY,ELEMENT> extends AbstractFormSection<ENTITY> implements org.eclipse.ui.forms.events.IExpansionListener, java.util.Observer
AbstractFormSection.ExpandListener
Modifier and Type | Field and Description |
---|---|
protected org.eclipse.swt.widgets.Composite |
container |
DEFAULT_NUM_COLUMNS, formFactory
CLIENT_INDENT, clientVerticalSpacing, COMPACT, descriptionVerticalSpacing, EXPANDED, FOCUS_TITLE, GAP, LEFT_TEXT_CLIENT_ALIGNMENT, marginHeight, marginWidth, NO_TITLE, NO_TITLE_FOCUS_BOX, SHORT_TITLE_BAR, textLabel, TITLE_BAR, titleBarTextMarginWidth, toggle, TREE_NODE, TWISTIE, VGAP
NOT_SELECTED, SELECTED
Constructor and Description |
---|
AbstractEntityCollectionSection(CdmFormFactory formFactory,
eu.etaxonomy.cdm.api.conversation.ConversationHolder conversation,
ICdmFormElement parentElement,
java.lang.String title,
int style) |
Modifier and Type | Method and Description |
---|---|
abstract void |
addElement(ELEMENT element)
Add an element to the entities collection
|
abstract ELEMENT |
addExisting()
Add an existing element to the entities collection.
|
abstract boolean |
allowAddExisting()
If
true the section will also display
a browse icon to choose from existing elements. |
protected void |
createDynamicContents(java.util.Collection<ELEMENT> elements)
Creates the widgets for the collection
|
protected void |
createElementComposite(ELEMENT element,
org.eclipse.swt.events.SelectionListener removeListener,
org.eclipse.swt.graphics.Color backgroundColor)
Create the specific widget for the element
|
protected void |
createEmptyContent() |
abstract ELEMENT |
createNewElement()
Create a new Element for this collection
|
protected org.eclipse.swt.widgets.Control |
createToolbar() |
void |
expansionStateChanged(org.eclipse.ui.forms.events.ExpansionEvent e) |
void |
expansionStateChanging(org.eclipse.ui.forms.events.ExpansionEvent e) |
abstract java.util.Collection<ELEMENT> |
getCollection(ENTITY entity)
Get the specific collection of this entity
|
abstract java.util.Comparator<ELEMENT> |
getComparator()
Returns the
Comparator specific for the ELEMENTs
which is used to sort the elements |
abstract java.lang.String |
getEmptyString()
String to display when the collection is empty
|
AbstractEntityCollectionElement<ENTITY> |
getEntityCollectionElement() |
java.lang.String |
getTitleString()
getTitleString
|
protected abstract java.lang.String |
getTooltipString()
getTooltipString
|
protected void |
internalUpdateSection(boolean changed)
Call this method after dynamically changing the client area.
|
abstract void |
removeElement(ELEMENT element)
Remove an element from the entities collection
|
void |
removeElementAndUpdate(ELEMENT element)
Remove an element from the entities collection and update the section
|
void |
removeToolbar()
using this method is discouraged, use updateToolBar() instead
|
void |
setBackground(org.eclipse.swt.graphics.Color color)
setBackground
|
void |
setEntity(ENTITY entity)
Setter for the field
entity . |
protected void |
setSectionTitle()
Sets the title for the section.
|
void |
setTitleString(java.lang.String title)
setTitleString
|
void |
showToolbar()
using this method is discouraged, use updateToolBar() instead
|
void |
update(java.util.Observable o,
java.lang.Object arg) |
addElement, addExpandListener, addSelectionListener, containsFormElement, dispose, firePropertyChangeEvent, firePropertyChangeEvent, firePropertyChangeEvent, getControls, getConversationHolder, getElements, getEntity, getFormFactory, getLayoutComposite, getParentElement, getPersistentBackground, getPropertyChangeListeners, getSection, getToggle, propertyChange, refresh, removeElement, removeElements, removeSelectionListener, selectionChanged, setFocus, setPersistentBackground, setPropertyChangeListeners, setSelected, update, widgetSelected
getDescription, getDescriptionControl, getSeparatorControl, getTitleBarBackground, getTitleBarBorderColor, getTitleBarGradientBackground, internalSetExpanded, onPaint, reflow, setBackgroundImage, setDescription, setDescriptionControl, setForeground, setSeparatorControl, setTitleBarBackground, setTitleBarBorderColor, setTitleBarGradientBackground
addExpansionListener, computeSize, forceFocus, getClient, getExpansionStyle, getText, getTextClient, getTextClientHeightDifference, getTitleBarForeground, hasTitleBar, isExpanded, isFixedStyle, removeExpansionListener, setActiveToggleColor, setClient, setEnabled, setExpanded, setFont, setLayout, setMenu, setText, setTextClient, setTitleBarForeground, setToggleColor, setToolTipText
drawBackground, getCaret, getIME, scroll, setCaret, setIME
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setLayoutDeferred, setTabList
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, dragDetect, dragDetect, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isAutoScalable, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBounds, setBounds, setCapture, setCursor, setDragDetect, setLayoutData, setLocation, setLocation, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
public AbstractEntityCollectionSection(CdmFormFactory formFactory, eu.etaxonomy.cdm.api.conversation.ConversationHolder conversation, ICdmFormElement parentElement, java.lang.String title, int style)
protected org.eclipse.swt.widgets.Control createToolbar()
public void showToolbar()
public void removeToolbar()
public void setEntity(ENTITY entity)
AbstractFormSection
Setter for the field entity
.
setEntity
in class AbstractFormSection<ENTITY>
entity
- a ENTITY object.protected void setSectionTitle()
protected void internalUpdateSection(boolean changed)
true
, will also fire a state changed
event to inform the user of unsaved changes.changed
- a boolean.protected void createEmptyContent()
protected void createDynamicContents(java.util.Collection<ELEMENT> elements)
elements
- a Collection
object.protected void createElementComposite(ELEMENT element, org.eclipse.swt.events.SelectionListener removeListener, org.eclipse.swt.graphics.Color backgroundColor)
element
- a ELEMENT object.removeListener
- a SelectionListener
object.backgroundColor
- a Color
object.public void setBackground(org.eclipse.swt.graphics.Color color)
setBackground
setBackground
in interface ICdmFormElement
setBackground
in class AbstractFormSection<ENTITY>
color
- a Color
object.public java.lang.String getTitleString()
getTitleString
String
object.public void setTitleString(java.lang.String title)
setTitleString
title
- a String
object.public void expansionStateChanging(org.eclipse.ui.forms.events.ExpansionEvent e)
expansionStateChanging
in interface org.eclipse.ui.forms.events.IExpansionListener
public void expansionStateChanged(org.eclipse.ui.forms.events.ExpansionEvent e)
expansionStateChanged
in interface org.eclipse.ui.forms.events.IExpansionListener
public void removeElementAndUpdate(ELEMENT element)
element
- a ELEMENT object.public void update(java.util.Observable o, java.lang.Object arg)
update
in interface java.util.Observer
public AbstractEntityCollectionElement<ENTITY> getEntityCollectionElement()
public abstract java.util.Comparator<ELEMENT> getComparator()
Comparator
specific for the ELEMENTs
which is used to sort the elementspublic abstract java.util.Collection<ELEMENT> getCollection(ENTITY entity)
entity
- a ENTITY object.Collection
object.public abstract ELEMENT createNewElement()
public abstract void addElement(ELEMENT element)
element
- a ELEMENT object.public abstract ELEMENT addExisting()
public abstract boolean allowAddExisting()
true
the section will also display
a browse icon to choose from existing elements.
addExisting()
methodpublic abstract void removeElement(ELEMENT element)
element
- a ELEMENT object.public abstract java.lang.String getEmptyString()
String
object.protected abstract java.lang.String getTooltipString()
getTooltipString
Copyright © 2007-2018. All Rights Reserved.