/**
- *
+ *
*/
package eu.etaxonomy.taxeditor.ui.element;
* <p>
* Abstract AbstractFormSection class.
* </p>
- *
+ *
* @author n.hoffmann
* @created Feb 22, 2010
* @version 1.0
private ENTITY entity;
- private Set<ICdmFormElement> elements = new HashSet<ICdmFormElement>();
+ private final Set<ICdmFormElement> elements = new HashSet<ICdmFormElement>();
protected CdmFormFactory formFactory;
* <p>
* Constructor for AbstractFormSection.
* </p>
- *
+ *
* @param conversation
* TODO
* @param style
* <p>
* Constructor for AbstractFormSection.
* </p>
- *
+ *
* @param formFactory
* a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
* object.
* <p>
* Getter for the field <code>propertyChangeListeners</code>.
* </p>
- *
+ *
* @return a {@link java.util.Set} object.
*/
- public List<IPropertyChangeListener> getPropertyChangeListeners() {
+ @Override
+ public List<IPropertyChangeListener> getPropertyChangeListeners() {
return propertyChangeListeners;
}
/** {@inheritDoc} */
- public void setPropertyChangeListeners(
+ @Override
+ public void setPropertyChangeListeners(
List<IPropertyChangeListener> propertyChangeListeners) {
this.propertyChangeListeners = propertyChangeListeners;
}
* <p>
* Setter for the field <code>entity</code>.
* </p>
- *
+ *
* @param entity
* a ENTITY object.
*/
/*
* (non-Javadoc)
- *
+ *
* @see eu.etaxonomy.taxeditor.forms.IEntityElement#getEntity()
*/
/**
* <p>
* Getter for the field <code>entity</code>.
* </p>
- *
+ *
* @return a ENTITY object.
*/
- public ENTITY getEntity() {
+ @Override
+ public ENTITY getEntity() {
return entity;
}
* <p>
* getToggle
* </p>
- *
+ *
* @return a {@link org.eclipse.ui.forms.widgets.ToggleHyperlink} object.
*/
public ToggleHyperlink getToggle() {
* <p>
* getSection
* </p>
- *
+ *
* @return a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
* object.
*/
/*
* (non-Javadoc)
- *
+ *
* @see
* eu.etaxonomy.taxeditor.forms.IPropertyChangeEmitter#firePropertyChangeEvent
* ()
*/
/** {@inheritDoc} */
- public void firePropertyChangeEvent(CdmPropertyChangeEvent event) {
+ @Override
+ public void firePropertyChangeEvent(CdmPropertyChangeEvent event) {
Assert.isNotNull(propertyChangeListeners,
"No property change listeners.");
try {
/**
* Fires a {@link CdmPropertyChangeEvent} with the given object as source.
- *
+ *
* @param object
* the object on which the property changed
*/
/**
* Fires a {@link CdmPropertyChangeEvent} with the given object as source
* also containing the originating event
- *
+ *
* @param object
* the object on which the property changed
* @param originatingEvent
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.swt.widgets.Composite#setFocus()
*/
/** {@inheritDoc} */
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse
* .jface.util.PropertyChangeEvent)
*/
/** {@inheritDoc} */
- public void propertyChange(PropertyChangeEvent event) {
+ @Override
+ public void propertyChange(PropertyChangeEvent event) {
firePropertyChangeEvent(new CdmPropertyChangeEvent(this, event));
}
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.swt.widgets.Control#setBackground(org.eclipse.swt.graphics
* .Color)
getLayoutComposite().setBackground(color);
super.setBackground(color);
}
-
+
@Override
public void setPersistentBackground(Color color) {
persistentBackgroundColor = color;
setBackground(color);
}
-
+
@Override
public Color getPersistentBackground() {
return persistentBackgroundColor;
}
-
+
/**
* <p>
* widgetSelected
* </p>
- *
+ *
* @param e
* a {@link org.eclipse.swt.events.SelectionEvent} object.
*/
}
/** {@inheritDoc} */
- public void setSelected(boolean selected) {
+ @Override
+ public void setSelected(boolean selected) {
if (selected) {
setBackground(Display.getCurrent().getSystemColor(
SWT.COLOR_LIST_SELECTION));
}
/** {@inheritDoc} */
- public void selectionChanged(SelectionChangedEvent event) {
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
if (event.getSelection() == CdmFormFactory.EMPTY_SELECTION) {
return;
}
* <p>
* addSelectionListener
* </p>
- *
+ *
* @param listener
* a {@link org.eclipse.swt.events.SelectionListener} object.
*/
* <p>
* removeSelectionListener
* </p>
- *
+ *
* @param listener
* a {@link org.eclipse.swt.events.SelectionListener} object.
*/
}
/** {@inheritDoc} */
- public void addElement(ICdmFormElement element) {
+ @Override
+ public void addElement(ICdmFormElement element) {
elements.add(element);
}
* <p>
* removeElement
* </p>
- *
+ *
* @param element
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
* removeElements
* </p>
*/
- public void removeElements() {
+ @Override
+ public void removeElements() {
for (ICdmFormElement childElement : getElements()) {
// recursion
childElement.removeElements();
* <p>
* Getter for the field <code>parentElement</code>.
* </p>
- *
+ *
* @return a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
*/
- public ICdmFormElement getParentElement() {
+ @Override
+ public ICdmFormElement getParentElement() {
return parentElement;
}
* <p>
* Getter for the field <code>elements</code>.
* </p>
- *
+ *
* @return a {@link java.util.Set} object.
*/
- public Set<ICdmFormElement> getElements() {
+ @Override
+ public Set<ICdmFormElement> getElements() {
return elements;
}
* <p>
* getControls
* </p>
- *
+ *
* @return a {@link java.util.Set} object.
*/
- public Set<Control> getControls() {
+ @Override
+ public Set<Control> getControls() {
Set<Control> controls = new HashSet<Control>();
for (Control control : getChildren()) {
* <p>
* getLayoutComposite
* </p>
- *
+ *
* @return a {@link org.eclipse.swt.widgets.Composite} object.
*/
- public Composite getLayoutComposite() {
+ @Override
+ public Composite getLayoutComposite() {
return (Composite) getClient();
}
/** {@inheritDoc} */
- public boolean containsFormElement(ICdmFormElement formElement) {
+ @Override
+ public boolean containsFormElement(ICdmFormElement formElement) {
if (formElement == this) {
return true;
} else {
* <p>
* Getter for the field <code>formFactory</code>.
* </p>
- *
+ *
* @return a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
*/
public CdmFormFactory getFormFactory() {
/*
* (non-Javadoc)
- *
+ *
* @see eu.etaxonomy.taxeditor.forms.ICdmFormElement#refresh()
*/
/**
* refresh
* </p>
*/
- public void refresh() {
+ @Override
+ public void refresh() {
// empty default implementation
}
* <p>
* getConversationHolder
* </p>
- *
+ *
* @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
* object.
*/
- public ConversationHolder getConversationHolder() {
+ @Override
+ public ConversationHolder getConversationHolder() {
if(getParentElement() instanceof RootElement || getParentElement() == null){
-
+
IEditorPart activeEditor = StoreUtil.getActiveEditor();
if(activeEditor instanceof IConversationEnabled){
ConversationHolder conversation = ((IConversationEnabled) StoreUtil.getActiveEditor()).getConversationHolder();
}else if(getParentElement() instanceof IConversationEnabled){
return ((IConversationEnabled) getParentElement()).getConversationHolder();
}
- StoreUtil.errorDialog("Could not get conversation for AbstractFormSection",
- getClass(), "There is an error in the implementation. There should have been an active editor but it wasn't",
+ StoreUtil.errorDialog("Could not get conversation for AbstractFormSection",
+ getClass(), "There is an error in the implementation. There should have been an active editor but it wasn't",
new IllegalArgumentException());
return null;
-
+
}
/** {@inheritDoc} */
- public void update(CdmDataChangeMap changeEvents) {
+ @Override
+ public void update(CdmDataChangeMap changeEvents) {
}
/**
- *
+ *
*/
package eu.etaxonomy.taxeditor.ui.element;
* <p>
* CdmFormFactory class.
* </p>
- *
+ *
* @author n.hoffmann
* @created Feb 24, 2010
* @version 1.0
return true;
}
};
-
+
/**
- *
+ *
* @author n.hoffmann
* @date Jan 25, 2010
*
}
/**
- *
+ *
* @author n.hoffmann
* @date Jan 25, 2010
*
* <p>
* Constructor for CdmFormFactory.
* </p>
- *
+ *
* @param display
* a {@link org.eclipse.swt.widgets.Display} object.
* @param selectionProvider
* <p>
* Constructor for CdmFormFactory.
* </p>
- *
+ *
* @param display
* a {@link org.eclipse.swt.widgets.Display} object.
*/
}
/**
- *
+ *
*/
private void init() {
boldFontHolder2 = new BoldFontHolder2();
/**
* Creates an instance initialized with the correct selectionProvider
- *
+ *
* Make sure to remove the instance when the entityComposite disposes via
* destroySelectionArbitrator(..)
- *
+ *
* @param entityElement
* a {@link eu.etaxonomy.taxeditor.ui.element.IEntityElement}
* object.
* <p>
* destroySelectionArbitrator
* </p>
- *
+ *
* @param selectionArbitrator
* a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator}
* object.
/**
* <p>
- * adapt
+ * Adapts the {@link AbstractCdmFormElement}:<br>
+ * - sets the {@link IPropertyChangeListener}s handled by this class
* </p>
- *
+ *
* @param formElement
* a
* {@link eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement}
* <p>
* destroyElement
* </p>
- *
+ *
* @param formElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
* <p>
* createEmptyCell
* </p>
- *
+ *
* @param parent
* a {@link org.eclipse.swt.widgets.Composite} object.
* @return a {@link org.eclipse.swt.widgets.Label} object.
* <p>
* createMultilineTextWithLabel
* </p>
- *
+ *
* @param labelString
* a {@link java.lang.String} object.
* @param textHeight
* <p>
* createMultiLanguageTextElement
* </p>
- *
+ *
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
* <p>
* createTextWithLabelElement
* </p>
- *
+ *
* @param labelString
* a {@link java.lang.String} object.
* @param initialText
}
/**
- *
+ *
* @param parentElement
* @param labelString
* @param conversationEnabled
* <p>
* createIntegerTextWithLabelElement
* </p>
- *
+ *
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
* <p>
* createFloatTextWithLabelElement
* </p>
- *
+ *
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
* <p>
* createLanguageStringWithLabelElement
* </p>
- *
+ *
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
* <p>
* createLanguageStringWithLabelElement
* </p>
- *
+ *
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
* <p>
* createTextElement
* </p>
- *
+ *
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
* <p>
* createKeyValueViewerElement
* </p>
- *
+ *
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
* <p>
* createTermComboElement
* </p>
- *
+ *
* @param termComboType
* a
* {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType}
* @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement}
* object.
*/
-
+
public <T extends DefinedTermBase> TermComboElement<T> createTermComboElement(
Class<T> termComboType, ICdmFormElement parentElement,
String labelString, T selection, int style) {
* <p>
* createEnumComboElement
* </p>
- *
+ *
* @param enumComboType
* a
* {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EnumComboType}
* <p>
* createBrowserElement
* </p>
- *
+ *
* @param imageUri
* a {@link java.net.URI} object.
* @param style
* <p>
* createImageElement
* </p>
- *
+ *
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
* <p>
* createTextActionElement
* </p>
- *
+ *
* @param labelString
* a {@link java.lang.String} object.
* @param initialText
* <p>
* createCheckbox
* </p>
- *
+ *
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
/**
* Creates a section as a part of the form.
- *
+ *
* @return the section widget
* @param section
* a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
* <p>
* createToggleableTextField
* </p>
- *
+ *
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
* <p>
* createTimePeriodElement
* </p>
- *
+ *
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
* <p>
* createPointElement
* </p>
- *
+ *
* @param style
* a int.
* @param parentElement
* <p>
* createDateDetailSection
* </p>
- *
+ *
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
* <p>
* createPartialElement
* </p>
- *
+ *
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
* <p>
* addSelectionListener
* </p>
- *
+ *
* @param listener
* a {@link org.eclipse.swt.events.SelectionListener} object.
*/
* <p>
* removeSelectionListener
* </p>
- *
+ *
* @param listener
* a {@link org.eclipse.swt.events.SelectionListener} object.
*/
* <p>
* addPropertyChangeListener
* </p>
- *
+ *
* @param listener
* a {@link org.eclipse.jface.util.IPropertyChangeListener}
* object.
* <p>
* removePropertyChangeListener
* </p>
- *
+ *
* @param listener
* a {@link org.eclipse.jface.util.IPropertyChangeListener}
* object.
* <p>
* createHorizontalSeparator
* </p>
- *
+ *
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
* <p>
* createVersionElement
* </p>
- *
+ *
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
parentElement.addElement(element);
return element;
}
-
+
/**
* @param cdmBaseSection
* @param object
* <p>
* createVersionSection
* </p>
- *
+ *
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
adapt(section);
return section;
}
-
+
/**
* @param parent
* @param i
* <p>
* createEmptyElement
* </p>
- *
+ *
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
* <p>
* createHeadlineSection
* </p>
- *
+ *
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
* <p>
* createParsingMessageElement
* </p>
- *
+ *
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
// SIMPLIFY
/**
- *
+ *
*/
public static enum DetailType {
- AUTHORSHIP,
- CLASSIFICATION,
- COLLECTION,
- DERIVED_UNIT,
- DERIVED_UNIT_FACADE,
- DERIVED_UNIT_GENERAL,
- DESCRIPTION,
- DESCRIPTIONELEMENT,
- DETERMINATION,
- FEATURE_DISTRIBUTION,
- FIELD_OBSERVATION,
- GATHERING_EVENT,
+ AUTHORSHIP,
+ CLASSIFICATION,
+ COLLECTION,
+ DERIVED_UNIT,
+ DERIVED_UNIT_FACADE,
+ DERIVED_UNIT_GENERAL,
+ DESCRIPTION,
+ DESCRIPTIONELEMENT,
+ DETERMINATION,
+ FEATURE_DISTRIBUTION,
+ FIELD_OBSERVATION,
+ GATHERING_EVENT,
GRANTEDAUTHORITY,
- GROUP,
- HYBRID,
- INSTITUTION,
- MEDIA,
- NAMED_AREA,
- NAMED_AREA_LEVEL,
- NAMERELATIONSHIP,
- NATURAL_LANGUAGE,
- NOMENCLATURALREFERENCE,
- NONVIRALNAME,
- PARSINGMESSAGE,
- PERSON,
- POLYTOMOUS_KEY,
- POLYTOMOUS_KEY_NODE,
- REFERENCEBASE,
- REFERENCED_ENTITY,
- SCIENTIFICNAME,
- TAXON_NODE,
- TAXON_RELATIONSHIP,
- TAXONBASE,
- TEAM,
- TEAMORPERSONBASE,
+ GROUP,
+ HYBRID,
+ INSTITUTION,
+ MEDIA,
+ NAMED_AREA,
+ NAMED_AREA_LEVEL,
+ NAMERELATIONSHIP,
+ NATURAL_LANGUAGE,
+ NOMENCLATURALREFERENCE,
+ NONVIRALNAME,
+ PARSINGMESSAGE,
+ PERSON,
+ POLYTOMOUS_KEY,
+ POLYTOMOUS_KEY_NODE,
+ REFERENCEBASE,
+ REFERENCED_ENTITY,
+ SCIENTIFICNAME,
+ TAXON_NODE,
+ TAXON_RELATIONSHIP,
+ TAXONBASE,
+ TEAM,
+ TEAMORPERSONBASE,
TERM_VOCABULARY,
USE_RECORD,
USER
}
-
+
public AbstractFormSection createDefinedTermDetailSection(Class definedTermClass,
ConversationHolder conversation, ICdmFormElement parentElement,
ISelectionProvider selectionProvider, int style) {
-
+
AbstractFormSection section = new DefinedTermDetailSection(this, definedTermClass, conversation, parentElement, selectionProvider, style);
-
+
parentElement.addElement(section);
adapt(section);
return section;
-
+
}
-
+
/**
* @param definedTermClass
* @param formElement
Class definedTermClass, AbstractCdmDetailSection parentElement,
int style) {
AbstractCdmDetailElement element = null;
-
+
if (NamedArea.class.isAssignableFrom(definedTermClass)){
element = new eu.etaxonomy.taxeditor.ui.section.vocabulary.NamedAreaDetailElement(this, parentElement);
}
else {
element = new DefinedTermDetailElement(this, parentElement);
}
-
+
adapt(element);
parentElement.addElement(element);
return element;
* <p>
* createCdmDetailSection
* </p>
- *
+ *
* @param detailType
* a
* {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType}
selectionProvider, style);
break;
case TAXON_RELATIONSHIP:
- section = new TaxonRelationshipDetailSection(this, conversation, parentElement,
+ section = new TaxonRelationshipDetailSection(this, conversation, parentElement,
selectionProvider, style);
break;
case REFERENCED_ENTITY:
- section = new ReferencedEntityDetailSection(this, conversation, parentElement,
+ section = new ReferencedEntityDetailSection(this, conversation, parentElement,
selectionProvider, style);
break;
case TERM_VOCABULARY:
- section = new TermVocabularyDetailSection(this, conversation, parentElement,
+ section = new TermVocabularyDetailSection(this, conversation, parentElement,
selectionProvider, style);
break;
case NAMED_AREA:
- section = new NamedAreaDetailSection(this, conversation, parentElement,
+ section = new NamedAreaDetailSection(this, conversation, parentElement,
selectionProvider, style);
break;
case USE_RECORD:
selectionProvider, style);
break;
}
-
+
if (section == null) {
throw new RuntimeException(
return section;
}
-
-
+
+
/**
* <p>
* createCdmDetailElement
* </p>
- *
+ *
* @param detailType
* a
* {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType}
}
/**
- *
+ *
* @author n.hoffmann
* @created Mar 5, 2010
* @version 1.0
*/
public static enum EntityDetailType {
- TEAM,
- TEAMMEMBER,
- ANNOTATION,
- CREDIT,
- DESCRIPTIONELEMENTSOURCE,
- EXTENSION,
- MARKER,
- MEDIA,
- DESCRIPTIONELEMENTMEDIA,
- MEDIAREPRESENTATION,
- MEDIAREPRESENTATIONPART,
- MODIFIER,
- NOMENCLATURALSTATUS,
- NAME_RELATIONSHIP,
- PROTOLOG,
- RIGHTS,
- SOURCE,
- SCOPE,
- DESCRIPTIONSOURCE,
- TYPEDESIGNATION,
- STATE_DATA,
- STATISTICAL_MEASUREMENT_VALUE,
- DESCRIBED_SPECIMEN,
- COLLECTING_AREA,
- DETERMINATION_EVENT,
- SPECIMEN_COLLECTION,
- IDENTIFIABLE_SOURCE_COLLECTION,
- GEOGRAPHICAL_SCOPE,
- SCOPE_RESTRICTION,
- MEMBER,
- GRANTED_AUTHORITY,
- GROUPS_BY_USER,
- TAXONOMIC_SCOPE,
- DETERMINATION_CURRENT,
+ TEAM,
+ TEAMMEMBER,
+ ANNOTATION,
+ CREDIT,
+ DESCRIPTIONELEMENTSOURCE,
+ EXTENSION,
+ MARKER,
+ MEDIA,
+ DESCRIPTIONELEMENTMEDIA,
+ MEDIAREPRESENTATION,
+ MEDIAREPRESENTATIONPART,
+ MODIFIER,
+ NOMENCLATURALSTATUS,
+ NAME_RELATIONSHIP,
+ PROTOLOG,
+ RIGHTS,
+ SOURCE,
+ SCOPE,
+ DESCRIPTIONSOURCE,
+ TYPEDESIGNATION,
+ STATE_DATA,
+ STATISTICAL_MEASUREMENT_VALUE,
+ DESCRIBED_SPECIMEN,
+ COLLECTING_AREA,
+ DETERMINATION_EVENT,
+ SPECIMEN_COLLECTION,
+ IDENTIFIABLE_SOURCE_COLLECTION,
+ GEOGRAPHICAL_SCOPE,
+ SCOPE_RESTRICTION,
+ MEMBER,
+ GRANTED_AUTHORITY,
+ GROUPS_BY_USER,
+ TAXONOMIC_SCOPE,
+ DETERMINATION_CURRENT,
DETERMINATION_HISTORY
}
* <p>
* createEntityDetailSection
* </p>
- *
+ *
* @param entityDetailType
* a
* {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType}
* @return a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
* object.
*/
- public AbstractFormSection createEntityDetailSection(
- EntityDetailType entityDetailType, ConversationHolder conversation,
- ICdmFormElement parentElement, int style) {
+ public AbstractFormSection createEntityDetailSection(EntityDetailType entityDetailType, ConversationHolder conversation, ICdmFormElement parentElement, int style) {
AbstractFormSection section = null;
switch (entityDetailType) {
case TEAM:
+ //TODO this is not an AbstractEntityCollectionSection
section = new TeamDetailSection(this, conversation, parentElement,
null, style);
break;
* <p>
* createEntityCollectionElement
* </p>
- *
+ *
* @param removeListener
* a {@link org.eclipse.swt.events.SelectionListener} object.
* @param style
element = new ImageFileElement(this, parentElement,
(ImageFile) entity, removeListener, style);
} else if (entity instanceof MediaRepresentationPart){
- element = new MediaRepresentationPartElement(this, parentElement,
- (MediaRepresentationPart) entity, removeListener, style);
+ element = new MediaRepresentationPartElement(this, parentElement,
+ (MediaRepresentationPart) entity, removeListener, style);
} else if (entity instanceof NomenclaturalStatus) {
element = new NomenclaturalStatusElement(this, parentElement,
(NomenclaturalStatus) entity, removeListener, style);
* <ul>
* <li>{@link TaxonNodeSelectionElement} see {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}</li>
* <li>{@link NomenclaturalAuthorTeamSelectionElement} see {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}</li>
- * </ul>
+ * </ul>
* </p>
- *
+ *
* @param clazz
* a {@link Class} object of the type that you want the selection element to handle
* @param parentElement
parentElement.addElement(element);
return element;
}
-
+
public TaxonNodeSelectionElement createTaxonNodeSelectionElement(
ConversationHolder conversation,
ICdmFormElement parentElement, String labelString,
parentElement.addElement(element);
return element;
}
-
+
public NomenclaturalAuthorTeamSelectionElement createNomenclaturalAuthorTeamSelectionElement(
ConversationHolder conversation,
ICdmFormElement parentElement, String labelString,
parentElement.addElement(element);
return element;
}
-
-
+
+
/** {@inheritDoc} */
public LabelElement createLabel(ICdmFormElement parentElement, String text) {
LabelElement labelElement = new LabelElement(this, parentElement, text);
* <p>
* Getter for the field <code>selectionProvider</code>.
* </p>
- *
+ *
* @return a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
*/
public ISelectionProvider getSelectionProvider() {
* <p>
* createDetailedDescriptionDetailElement
* </p>
- *
+ *
* @param parentElement
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
* object.
/**
* Creates a styled text as a part of the form.
- *
+ *
* @param parent
* the text parent
* @param value
public StyledText createStyledText(Composite parent, String value, int style) {
StyledText text = new StyledText(parent, getBorderStyle() | style
| getOrientation());
- if (value != null)
- text.setText(value);
+ if (value != null) {
+ text.setText(value);
+ }
text.setForeground(getColors().getForeground());
text.setBackground(getColors().getBackground());
// text.addFocusListener(visibilityHandler);
// $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.
*/
* @version 1.0
*/
public class DerivedUnitFacadeDetailElement extends AbstractCdmDetailElement<DerivedUnitBase> {
-
+
private DerivedUnitFacade facade;
private DerivedUnitFacadeConfigurator configurator;
configurator.setMoveDerivedUnitMediaToGallery(true);
configurator.setMoveFieldObjectMediaToGallery(true);
}
-
+
/** {@inheritDoc} */
@Override
public void setEntity(DerivedUnitBase entity) {
super.setEntity(entity);
try {
facade = DerivedUnitFacade.NewInstance(entity, configurator);
-
+
section_general.setEntity(facade);
section_derivedUnitBase.setEntity(facade);
section_gatheringEvent.setEntity(facade);
section_fieldObservation.setEntity(facade);
-
+
} catch (DerivedUnitFacadeNotSupportedException e) {
StoreUtil.errorDialog("Error", this, "SpecimenFacadeNotSupportedException while inititating SpecimenFacade", e);
}
}
-
+
/** {@inheritDoc} */
@Override
public void removeElements() {
section_fieldObservation = null;
}
}
-
+
/** {@inheritDoc} */
@Override
public DerivedUnitBase getEntity() {
throw new IllegalArgumentException("Should not be called");
}
-
+
/**
* <p>Getter for the field <code>facade</code>.</p>
*
public DerivedUnitFacade getFacade(){
return facade;
}
-
+
/** {@inheritDoc} */
@Override
protected void createControls(ICdmFormElement formElement,
DerivedUnitBase entity, int style) {
-
+
section_general = (GeneralDetailSection) formFactory.createCdmDetailSection(DetailType.DERIVED_UNIT_GENERAL, getConversationHolder(), formElement, null, Section.TWISTIE | Section.EXPANDED);
section_general.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
addControl(section_general);
addElement(section_general);
-
+
section_gatheringEvent = (GatheringEventDetailSection) formFactory.createCdmDetailSection(DetailType.GATHERING_EVENT, getConversationHolder(), formElement, null, Section.TWISTIE);
section_gatheringEvent.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
addControl(section_gatheringEvent);
addElement(section_gatheringEvent);
-
+
section_fieldObservation = (FieldObservationDetailSection) formFactory.createCdmDetailSection(DetailType.FIELD_OBSERVATION, getConversationHolder(), formElement, null, Section.TWISTIE);
section_fieldObservation.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
addControl(section_fieldObservation);
addElement(section_fieldObservation);
-
+
section_derivedUnitBase = (DerivedUnitBaseDetailSection) formFactory.createCdmDetailSection(DetailType.DERIVED_UNIT, getConversationHolder(), formElement, null, Section.TWISTIE);
section_derivedUnitBase.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
addControl(section_derivedUnitBase);
@Override
public void handleEvent(Object eventSource) {
if(eventSource == section_derivedUnitBase || eventSource == section_gatheringEvent || eventSource == section_fieldObservation){
- if(getParentElement() instanceof AbstractCdmDetailSection)
- ((AbstractCdmDetailSection) getParentElement()).updateTitle();
+ if(getParentElement() instanceof AbstractCdmDetailSection) {
+ ((AbstractCdmDetailSection) getParentElement()).updateTitle();
+ }
}
}
}
// $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.
*/
package eu.etaxonomy.taxeditor.ui.section.occurrence;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
-import eu.etaxonomy.cdm.model.description.Sex;
-import eu.etaxonomy.cdm.model.description.Stage;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
* @version 1.0
*/
public class FieldObservationDetailElement extends AbstractCdmDetailElement<DerivedUnitFacade> {
-
+
private TextWithLabelElement text_ecology;
private TextWithLabelElement text_plantDescription;
private NumberWithLabelElement number_individualCount;
- private TermComboElement<Sex> combo_sex;
+// private TermComboElement<Sex> combo_sex;
+//
+// private TermComboElement<Stage> combo_lifeStage;
- private TermComboElement<Stage> combo_lifeStage;
-
/**
* <p>Constructor for FieldObservationDetailElement.</p>
*
ICdmFormElement formElement) {
super(formFactory, formElement);
}
-
+
/** {@inheritDoc} */
@Override
protected void createControls(ICdmFormElement formElement,
// Disable for now
// text_fieldObjectDefinition = formFactory.createTextWithLabelElement(formElement, "Field Object Definition", entity.getFieldObjectDefinition(CdmStore.getDefaultLanguage()), style);
text_fieldNotes = formFactory.createTextWithLabelElement(formElement, "Field Notes", entity.getFieldNotes(), style);
-
+
number_individualCount = formFactory.createIntegerTextWithLabelElement(formElement, "Individual Count", entity.getIndividualCount(), style);
- combo_lifeStage = formFactory.createTermComboElement(Stage.class, formElement, "Life Stage", entity.getLifeStage(), style);
- combo_sex = formFactory.createTermComboElement(Sex.class, formElement, "Sex", entity.getSex(), style);
+// combo_lifeStage = formFactory.createTermComboElement(Stage.class, formElement, "Life Stage", entity.getLifeStage(), style);
+// combo_sex = formFactory.createTermComboElement(Sex.class, formElement, "Sex", entity.getSex(), style);
}
/** {@inheritDoc} */
else if(eventSource == number_individualCount){
getEntity().setIndividualCount(number_individualCount.getInteger());
}
- else if(eventSource == combo_lifeStage){
- getEntity().setLifeStage(combo_lifeStage.getSelection());
- }
- else if(eventSource == combo_sex){
- getEntity().setSex(combo_sex.getSelection());
- }
+// else if(eventSource == combo_lifeStage){
+// getEntity().setLifeStage(combo_lifeStage.getSelection());
+// }
+// else if(eventSource == combo_sex){
+// getEntity().setSex(combo_sex.getSelection());
+// }
}
}
// $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.
*/
package eu.etaxonomy.taxeditor.ui.section.occurrence;
-import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.preference.Resources;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
* <p>
* GatheringEventDetailElement class.
* </p>
- *
+ *
* @author n.hoffmann
* @created Jun 24, 2010
* @version 1.0
* <p>
* Constructor for GatheringEventDetailElement.
* </p>
- *
+ *
* @param formFactory
* a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
* object.
super(formFactory, formElement);
}
- /** {@inheritDoc} */
- @Override
- protected void createControls(ICdmFormElement formElement,
- DerivedUnitFacade entity, int style) {
- // collectingArea
- number_absoluteElevationError = formFactory
- .createIntegerTextWithLabelElement(formElement,
- "Elevation Error", entity.getAbsoluteElevationError(),
- style);
- number_absoluteElevationMinimum = formFactory
- .createIntegerTextWithLabelElement(formElement,
- "Elevation Minimum (m)",
- entity.getAbsoluteElevationMinimum(), style);
- number_absoluteElevationMaximum = formFactory
- .createIntegerTextWithLabelElement(formElement,
- "Elevation Maximum (m)",
- entity.getAbsoluteElevationMaximum(), style);
-
- text_collectingMethod = formFactory.createTextWithLabelElement(
- formElement, "Collecting Method", entity.getCollectingMethod(),
- style);
-
- number_distanceToGround = formFactory
- .createIntegerTextWithLabelElement(formElement,
- "Distance To Ground (m)", entity.getDistanceToGround(),
- style);
- number_distanceToWaterSurface = formFactory
- .createIntegerTextWithLabelElement(formElement,
- "Distance To Water Surface (m)",
- entity.getDistanceToWaterSurface(), style);
- // exactLocation
- text_gatheringEventDescription = formFactory
- .createTextWithLabelElement(formElement,
- "Gathering Event Description",
- entity.getGatheringEventDescription(), style);
-
- section_collectingAreas = (CollectingAreasDetailSection) formFactory
- .createEntityDetailSection(EntityDetailType.COLLECTING_AREA,
- getConversationHolder(), formElement, Section.TWISTIE);
- section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(
- 2, 1));
- section_collectingAreas.setEntity(entity);
- }
+ /** {@inheritDoc} */
+ @Override
+ protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
+ // collectingArea
+ number_absoluteElevationError = formFactory.createIntegerTextWithLabelElement(
+ formElement, "Elevation Error", entity.getAbsoluteElevationError(), style);
+ number_absoluteElevationMinimum = formFactory.createIntegerTextWithLabelElement(
+ formElement, "Elevation Minimum (m)", entity.getAbsoluteElevationMinimum(), style);
+ number_absoluteElevationMaximum = formFactory.createIntegerTextWithLabelElement(
+ formElement, "Elevation Maximum (m)", entity.getAbsoluteElevationMaximum(), style);
+
+ text_collectingMethod = formFactory.createTextWithLabelElement(
+ formElement, "Collecting Method", entity.getCollectingMethod(), style);
+
+ number_distanceToGround = formFactory.createIntegerTextWithLabelElement(
+ formElement, "Distance To Ground (m)", entity.getDistanceToGround(), style);
+ number_distanceToWaterSurface = formFactory.createIntegerTextWithLabelElement(
+ formElement, "Distance To Water Surface (m)", entity.getDistanceToWaterSurface(), style);
+ // exactLocation
+ text_gatheringEventDescription = formFactory.createTextWithLabelElement(
+ formElement, "Gathering Event Description", entity.getGatheringEventDescription(), style);
+
+ section_collectingAreas = (CollectingAreasDetailSection) formFactory.createEntityDetailSection(
+ EntityDetailType.COLLECTING_AREA, getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+ section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+ section_collectingAreas.setEntity(entity);
+ }
/** {@inheritDoc} */
@Override
} catch (IllegalArgumentException e) {
number_absoluteElevationMinimum
.setBackground(getColor(Resources.COLOR_PARSE_ERROR));
- StoreUtil.warn(getClass(), e.getLocalizedMessage());
+ AbstractUtility.warn(getClass(), e.getLocalizedMessage());
}
} else if (eventSource == number_absoluteElevationMaximum) {
try {
} catch (IllegalArgumentException e) {
number_absoluteElevationMaximum
.setBackground(getColor(Resources.COLOR_PARSE_ERROR));
- StoreUtil.warn(getClass(), e.getLocalizedMessage());
+ AbstractUtility.warn(getClass(), e.getLocalizedMessage());
}
} else if (eventSource == text_collectingMethod) {
getEntity().setCollectingMethod(text_collectingMethod.getText());
// $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 eu.etaxonomy.cdm.model.agent.AgentBase;
import eu.etaxonomy.cdm.model.common.LanguageString;
import eu.etaxonomy.cdm.model.location.NamedArea;
-import eu.etaxonomy.cdm.model.occurrence.Collection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement;
private TimePeriodElement element_date;
private EntitySelectionElement<AgentBase> selection_collector;
private TextWithLabelElement text_collectingNumber;
- private EntitySelectionElement<Collection> selection_collection;
- private TextWithLabelElement text_accessionNumber;
+// private EntitySelectionElement<Collection> selection_collection;
+// private TextWithLabelElement text_accessionNumber;
/**
* @param formFactory
/*
* (non-Javadoc)
- *
+ *
* @see
* eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls
* (eu.etaxonomy.taxeditor.forms.ICdmFormElement, java.lang.Object, int)
entity.getCountry(), EntitySelectionElement.NOTHING, style);
languageText_locality = formFactory
.createLanguageStringWithLabelElement(formElement, "Locality",
- entity.getLocality(), style);
+ entity.getLocality(), style);
element_point = formFactory.createPointElement(formElement,
entity.getExactLocation(), style);
number_elevation = formFactory.createIntegerTextWithLabelElement(
style);
text_collectingNumber = formFactory.createTextWithLabelElement(formElement,
"Collecting number", entity.getFieldNumber(), style);
- selection_collection = formFactory
- .createSelectionElement(Collection.class,
- getConversationHolder(), formElement, "Collection",
- entity.getCollection(),
- EntitySelectionElement.ALL, style);
- text_accessionNumber = formFactory.createTextWithLabelElement(
- formElement, "Accession Number", entity.getAccessionNumber(),
- style);
-
+// selection_collection = formFactory
+// .createSelectionElement(Collection.class,
+// getConversationHolder(), formElement, "Collection",
+// entity.getCollection(),
+// EntitySelectionElement.ALL, style);
+// text_accessionNumber = formFactory.createTextWithLabelElement(
+// formElement, "Accession Number", entity.getAccessionNumber(),
+// style);
+
}
/*
* (non-Javadoc)
- *
+ *
* @see
* eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
* .lang.Object)
getEntity().setCollector(selection_collector.getSelection());
} else if (eventSource == text_collectingNumber) {
getEntity().setFieldNumber(text_collectingNumber.getText());
- } else if (eventSource == selection_collection) {
- getEntity().setCollection(selection_collection.getSelection());
- } else if (eventSource == text_accessionNumber) {
- getEntity().setAccessionNumber(text_accessionNumber.getText());
}
+// else if (eventSource == selection_collection) {
+// getEntity().setCollection(selection_collection.getSelection());
+// } else if (eventSource == text_accessionNumber) {
+// getEntity().setAccessionNumber(text_accessionNumber.getText());
+// }
if (eventSource != toggleableText_titleCache) {
toggleableText_titleCache.setText(getEntity().getTitleCache());
// $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.
*/
package eu.etaxonomy.taxeditor.view;
-import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.widgets.Composite;
* @created Feb 9, 2010
* @version 1.0
*/
-public abstract class AbstractCdmDataViewer extends Viewer implements ISelectionProvider, IConversationEnabled{
-
+public abstract class AbstractCdmDataViewer extends Viewer implements IConversationEnabled{
+
protected ManagedForm managedForm;
protected CdmFormFactory formFactory;
protected ScrolledForm scrolledForm;
-
- private Composite body;
-
+
+ private final Composite body;
+
protected RootElement rootElement;
+ //TODO: create a super class for this?
private Object input;
- private AbstractCdmViewPart viewPart;
+ private final AbstractCdmViewPart viewPart;
+
-
/**
* <p>Constructor for AbstractCdmDataViewer.</p>
*
*/
public AbstractCdmDataViewer(Composite parent, AbstractCdmViewPart viewPart) {
this.viewPart = viewPart;
-
+
managedForm = new ManagedForm(parent){
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.forms.ManagedForm#dirtyStateChanged()
*/
markViewPartDirty();
}
};
-
+
createFormFactory();
-
+
scrolledForm = managedForm.getForm();
-
+
body = scrolledForm.getBody();
-
+
body.setLayout(LayoutConstants.LAYOUT());
-
+
rootElement = new RootElement(formFactory, body);
}
-
+
/**
* <p>createFormFactory</p>
*/
protected void markViewPartDirty(){
viewPart.changed(input);
}
-
-
+
+
/**
* @return
*/
for(Control child : body.getChildren()){
return child;
}
-
+
return body;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.Viewer#setInput(java.lang.Object)
*/
/** {@inheritDoc} */
@Override
public void setInput(Object input) {
- this.input = input;
+ this.input = input;
// reset selection
setSelection(new StructuredSelection(input));
refresh();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.Viewer#getInput()
*/
public Object getInput() {
return input;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.Viewer#refresh()
*/
@Override
public void refresh() {
showParts();
-
+
managedForm.setInput(input);
-
+
managedForm.refresh();
-
+
managedForm.reflow(true);
}
-
+
/**
* <p>layout</p>
*/
public void layout(){
body.layout();
}
-
+
/**
* <p>showParts</p>
*/
protected abstract void showParts();
-
-
+
+
/**
* <p>destroySections</p>
*/
- protected void destroySections() {
+ protected void destroySections() {
for (IFormPart formPart : managedForm.getParts()){
removePart((CdmSectionPart) formPart);
- }
-
+ }
+
managedForm.setInput(null);
-
+
formFactory.destroyElement(rootElement);
-
+
createFormFactory();
-
+
rootElement = new RootElement(formFactory, body);
-
+
for(Control control : body.getChildren()){
control.dispose();
control = null;
}
}
-
-
+
+
/**
* <p>setFocus</p>
*/
break;
}
}
-
+
/**
* <p>reflow</p>
*/
public void reflow(){
managedForm.reflow(true);
}
-
+
/**
* <p>removePart</p>
*
managedForm.removePart(sectionPart);
formFactory.removePropertyChangeListener(sectionPart);
}
-
+
/**
* <p>addPart</p>
*
managedForm.addPart(sectionPart);
formFactory.addPropertyChangeListener(sectionPart);
}
-
+
/**
* <p>getConversationHolder</p>
*
* @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
*/
- public ConversationHolder getConversationHolder() {
+ @Override
+ public ConversationHolder getConversationHolder() {
return viewPart.getConversationHolder();
}
-
+
/** {@inheritDoc} */
- public void update(CdmDataChangeMap changeEvents) {}
+ @Override
+ public void update(CdmDataChangeMap changeEvents) {}
}
// $Id$
/**
* Copyright (C) 2011 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.jface.viewers.SelectionChangedEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
import eu.etaxonomy.cdm.model.media.Media;
import eu.etaxonomy.cdm.model.name.NonViralName;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;
+import eu.etaxonomy.cdm.model.occurrence.FieldObservation;
+import eu.etaxonomy.cdm.model.occurrence.Specimen;
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
-
import eu.etaxonomy.taxeditor.editor.UsageTermCollection;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType;
import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityDetailSection;
import eu.etaxonomy.taxeditor.ui.section.group.GroupDetailSection;
import eu.etaxonomy.taxeditor.ui.section.group.MemberDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.key.GeographicalScopeDetailSection;
import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyDetailSection;
import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyNodeDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.key.ScopeRestrictionSection;
import eu.etaxonomy.taxeditor.ui.section.key.TaxonomicScopeSection;
import eu.etaxonomy.taxeditor.ui.section.name.NameRelationshipDetailSection;
import eu.etaxonomy.taxeditor.ui.section.name.NomenclaturalStatusSection;
* <p>
* DetailsViewer class.
* </p>
- *
+ *
* @author n.hoffmann
* @created Feb 12, 2010
* @version 1.0
* <p>
* Constructor for DetailsViewer.
* </p>
- *
+ *
* @param parent
* a {@link org.eclipse.swt.widgets.Composite} object.
* @param viewPart
/*
* (non-Javadoc)
- *
+ *
* @see
* eu.etaxonomy.taxeditor.editor.view.AbstractCdmDataViewer#setInput(java
* .lang.Object)
public void setInput(Object input) {
if (input instanceof DerivedUnitBase) {
try {
- input = DerivedUnitFacade.NewInstance((DerivedUnitBase) input,
- PreferencesUtil.getDerivedUnitConfigurator());
+ input = DerivedUnitFacade.NewInstance((DerivedUnitBase) input, PreferencesUtil.getDerivedUnitConfigurator());
} catch (DerivedUnitFacadeNotSupportedException e) {
- StoreUtil.error(getClass(), e);
+ AbstractUtility.error(getClass(), e);
}
}
super.setInput(input);
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.viewers.Viewer#refresh()
*/
/** {@inheritDoc} */
// Too much type checking to decide which detail view to display.
// Need to build in a mechanism where navigators / editors are 'aware'
// of the corresponding detail viewer.
- if (getInput() instanceof TaxonBase) {
+ Object input = getInput();
+ if (input instanceof TaxonBase) {
createTaxonSections(rootElement);
- } else if (getInput() instanceof NonViralName) {
+ } else if (input instanceof NonViralName) {
createNameSections(rootElement);
- } else if (getInput() instanceof Reference) {
+ } else if (input instanceof Reference) {
createReferenceSections(rootElement);
- } else if (getInput() instanceof Team) {
+ } else if (input instanceof Team) {
createTeamDetailSection(rootElement);
- } else if (getInput() instanceof Person) {
+ } else if (input instanceof Person) {
createPersonDetailSection(rootElement);
- } else if (getInput() instanceof TeamOrPersonBase) {
+ } else if (input instanceof TeamOrPersonBase) {
createTeamOrPersonBaseDetailSection(rootElement);
- } else if (getInput() instanceof DescriptionBase) {
- Set<Marker> descriptionMarkers = ((DescriptionBase) getInput()).getMarkers();
+ } else if (input instanceof DescriptionBase) {
+ Set<Marker> descriptionMarkers = ((DescriptionBase) input).getMarkers();
MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseMarkerType);
Boolean isUseDescription = false;
for (Marker marker : descriptionMarkers) {
isUseDescription = true;
}
}
- if (((DescriptionBase) getInput()).isImageGallery()) {
+ if (((DescriptionBase) input).isImageGallery()) {
createImageGallerySection(rootElement);
- } else if (isUseDescription) {
+ } else if (isUseDescription) {
createUseDescriptionSection(rootElement);
} else {
createDescriptionSection(rootElement);
}
- } else if (getInput() instanceof DescriptionElementBase) {
- Set<Marker> descriptionMarkers = ((DescriptionElementBase) getInput()).getInDescription().getMarkers();
+ } else if (input instanceof DescriptionElementBase) {
+ Set<Marker> descriptionMarkers = ((DescriptionElementBase) input).getInDescription().getMarkers();
MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseMarkerType);
Boolean isUseDescription = false;
for (Marker marker : descriptionMarkers) {
isUseDescription = true;
}
}
-
- if (isUseDescription == true && getInput() instanceof CategoricalData ) {
+
+ if (isUseDescription == true && input instanceof CategoricalData ) {
createUseRecordSection(rootElement);
}
else {
createDescriptionElementSection(rootElement);
}
- } else if (getInput() instanceof Media) {
+ } else if (input instanceof Media) {
createMediaElementSection(rootElement);
- } else if (getInput() instanceof DerivedUnitFacade) {
+ } else if (input instanceof DerivedUnitFacade) {
createDerivedUnitBaseElementSection(rootElement);
- } else if (getInput() instanceof FeatureNodeContainer) {
+ } else if (input instanceof FeatureNodeContainer) {
createFeatureDistributionSection(rootElement);
- } else if (getInput() instanceof PolytomousKey) {
+ } else if (input instanceof PolytomousKey) {
//createPolytomousKeySection(rootElement);
- } else if ((getInput() instanceof PolytomousKeyNode)
- || (getInput() instanceof PolytomousKeyRelationship)) {
+ } else if ((input instanceof PolytomousKeyNode)
+ || (input instanceof PolytomousKeyRelationship)) {
createPolytomousKeyNodeSection(rootElement);
-
- } else if (getInput() instanceof User) {
+ } else if (input instanceof User) {
createUserSection(rootElement);
-
- } else if (getInput() instanceof Group) {
+ } else if (input instanceof Group) {
createGroupSection(rootElement);
-
- } else if (getInput() instanceof TaxonRelationship) {
+ } else if (input instanceof TaxonRelationship) {
createTaxonRelationshipSection(rootElement);
-
- } else if (getInput() instanceof TermVocabulary) {
+ } else if (input instanceof TermVocabulary) {
createTermVocabularySection(rootElement);
-
- } else if (getInput() instanceof DefinedTermBase) {
+ } else if (input instanceof DefinedTermBase) {
createDefinedTermSection(rootElement);
} else {
destroySections();
layout();
}
-
+
/**
* @param rootElement
*/
GroupDetailSection groupDetailSection = (GroupDetailSection) formFactory
.createCdmDetailSection(DetailType.GROUP,
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.EXPANDED);
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
MemberDetailSection memberDetailSection = (MemberDetailSection) formFactory
.createEntityDetailSection(EntityDetailType.MEMBER,
- getConversationHolder(), parent, Section.TWISTIE
- | Section.EXPANDED);
+ getConversationHolder(), parent, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
GrantedAuthorityDetailSection grantedAuthorityDetailSection = (GrantedAuthorityDetailSection) formFactory
.createEntityDetailSection(EntityDetailType.GRANTED_AUTHORITY,
- getConversationHolder(), parent, Section.TWISTIE
- | Section.EXPANDED);
+ getConversationHolder(), parent, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
addPart(groupDetailSection);
addPart(memberDetailSection);
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.viewers.Viewer#getSelection()
*/
/** {@inheritDoc} */
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers
* .ISelection, boolean)
@Override
public void setSelection(ISelection selection, boolean reveal) {
this.selection = selection;
- SelectionChangedEvent selectionChangedEvent = new SelectionChangedEvent(
- this, selection);
+ SelectionChangedEvent selectionChangedEvent = new SelectionChangedEvent(this, selection);
fireSelectionChanged(selectionChangedEvent);
}
TaxonBaseDetailSection taxonBaseDetailSection = (TaxonBaseDetailSection) formFactory
.createCdmDetailSection(DetailType.TAXONBASE,
- getConversationHolder(), parent, this, Section.TWISTIE);
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
NonViralNameDetailSection nonViralNameSection = (NonViralNameDetailSection) formFactory
.createCdmDetailSection(DetailType.NONVIRALNAME,
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.EXPANDED);
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
NomenclaturalReferenceDetailSection referenceDetailSection = (NomenclaturalReferenceDetailSection) formFactory
.createCdmDetailSection(DetailType.NOMENCLATURALREFERENCE,
- getConversationHolder(), parent, this, Section.TWISTIE);
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
NomenclaturalStatusSection nomenclaturalStatusSection = (NomenclaturalStatusSection) formFactory
.createEntityDetailSection(
EntityDetailType.NOMENCLATURALSTATUS,
- getConversationHolder(), parent, Section.TWISTIE);
+ getConversationHolder(), parent, ExpandableComposite.TWISTIE);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
ProtologueSection protologSection = (ProtologueSection) formFactory
.createEntityDetailSection(EntityDetailType.PROTOLOG,
- getConversationHolder(), parent, Section.TWISTIE);
+ getConversationHolder(), parent, ExpandableComposite.TWISTIE);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
TypeDesignationSection typeDesignationSection = (TypeDesignationSection) formFactory
.createEntityDetailSection(EntityDetailType.TYPEDESIGNATION,
- getConversationHolder(), parent, Section.TWISTIE);
+ getConversationHolder(), parent, ExpandableComposite.TWISTIE);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
NameRelationshipDetailSection nameRelationshipSection = (NameRelationshipDetailSection) formFactory
.createEntityDetailSection(EntityDetailType.NAME_RELATIONSHIP,
- getConversationHolder(), parent, Section.TWISTIE);
+ getConversationHolder(), parent, ExpandableComposite.TWISTIE);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
ParsingMessagesSection parsingMessagesSection = (ParsingMessagesSection) formFactory
.createCdmDetailSection(DetailType.PARSINGMESSAGE,
- getConversationHolder(), parent, this, Section.EXPANDED);
+ getConversationHolder(), parent, this, ExpandableComposite.EXPANDED);
addPart(taxonBaseDetailSection);
addPart(nonViralNameSection);
destroySections();
NonViralNameDetailSection nonViralNameSection = (NonViralNameDetailSection) formFactory
.createCdmDetailSection(DetailType.NONVIRALNAME,
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.EXPANDED);
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
NomenclaturalReferenceDetailSection referenceDetailSection = (NomenclaturalReferenceDetailSection) formFactory
.createCdmDetailSection(DetailType.NOMENCLATURALREFERENCE,
- getConversationHolder(), parent, this, Section.TWISTIE);
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
NomenclaturalStatusSection nomenclaturalStatusSection = (NomenclaturalStatusSection) formFactory
.createEntityDetailSection(
EntityDetailType.NOMENCLATURALSTATUS,
- getConversationHolder(), parent, Section.TWISTIE);
+ getConversationHolder(), parent, ExpandableComposite.TWISTIE);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
ProtologueSection protologSection = (ProtologueSection) formFactory
.createEntityDetailSection(EntityDetailType.PROTOLOG,
- getConversationHolder(), parent, Section.TWISTIE);
+ getConversationHolder(), parent, ExpandableComposite.TWISTIE);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
TypeDesignationSection typeDesignationSection = (TypeDesignationSection) formFactory
.createEntityDetailSection(EntityDetailType.TYPEDESIGNATION,
- getConversationHolder(), parent, Section.TWISTIE);
+ getConversationHolder(), parent, ExpandableComposite.TWISTIE);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
NameRelationshipDetailSection nameRelationshipSection = (NameRelationshipDetailSection) formFactory
.createEntityDetailSection(EntityDetailType.NAME_RELATIONSHIP,
- getConversationHolder(), parent, Section.TWISTIE);
+ getConversationHolder(), parent, ExpandableComposite.TWISTIE);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
ReferenceDetailSection referenceDetailSection = (ReferenceDetailSection) formFactory
.createCdmDetailSection(DetailType.REFERENCEBASE,
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.EXPANDED);
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
addPart(referenceDetailSection);
}
destroySections();
TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = (TeamOrPersonBaseDetailSection) formFactory
.createCdmDetailSection(DetailType.TEAMORPERSONBASE,
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.EXPANDED);
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
addPart(teamOrPersonBaseDetailSection);
}
destroySections();
TeamDetailSection teamDetailSection = (TeamDetailSection) formFactory
.createCdmDetailSection(DetailType.TEAM,
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.EXPANDED);
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
addPart(teamDetailSection);
}
-
+
/**
* createPersonDetailSection
* @param parent
destroySections();
PersonDetailSection personDetailSection = (PersonDetailSection) formFactory
.createCdmDetailSection(DetailType.PERSON,
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.EXPANDED);
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
addPart(personDetailSection);
}
DescriptionElementDetailSection descriptionElementDetailSection = (DescriptionElementDetailSection) formFactory
.createCdmDetailSection(DetailType.DESCRIPTIONELEMENT,
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.EXPANDED);
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
DescriptionElementSourceSection descriptionElementSourceSection = (DescriptionElementSourceSection) formFactory
.createEntityDetailSection(
EntityDetailType.DESCRIPTIONELEMENTSOURCE,
- getConversationHolder(), parent, Section.TWISTIE);
+ getConversationHolder(), parent, ExpandableComposite.TWISTIE);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
DescriptionElementMediaSection descriptionElementMediaSection = (DescriptionElementMediaSection) formFactory
.createEntityDetailSection(
EntityDetailType.DESCRIPTIONELEMENTMEDIA,
- getConversationHolder(), parent, Section.TWISTIE);
+ getConversationHolder(), parent, ExpandableComposite.TWISTIE);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
destroySections();
DescriptionDetailSection descriptionDetailSection = (DescriptionDetailSection) formFactory
.createCdmDetailSection(DetailType.DESCRIPTION,
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.EXPANDED);
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
NaturalLanguageSection naturalLanguageSection = (NaturalLanguageSection) formFactory
.createCdmDetailSection(DetailType.NATURAL_LANGUAGE,
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.EXPANDED);
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
DescribedSpecimenSection describedSpecimenSection = (DescribedSpecimenSection) formFactory
.createEntityDetailSection(EntityDetailType.DESCRIBED_SPECIMEN,
- getConversationHolder(), parent, Section.TWISTIE);
+ getConversationHolder(), parent, ExpandableComposite.TWISTIE);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
.createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
- getConversationHolder(), parent, Section.TWISTIE);
+ getConversationHolder(), parent, ExpandableComposite.TWISTIE);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
ScopeSection scopeSection = (ScopeSection) formFactory
.createEntityDetailSection(EntityDetailType.SCOPE,
- getConversationHolder(), parent, Section.TWISTIE);
+ getConversationHolder(), parent, ExpandableComposite.TWISTIE);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
addPart(descriptionSourceSection);
addPart(scopeSection);
}
-
+
/**
* Creates the use Description section
* @param parent
destroySections();
DescriptionDetailSection descriptionDetailSection = (DescriptionDetailSection) formFactory
.createCdmDetailSection(DetailType.DESCRIPTION,
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.EXPANDED);
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
.createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
- getConversationHolder(), parent, Section.TWISTIE
- | Section.EXPANDED);
+ getConversationHolder(), parent, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
addPart(descriptionDetailSection);
addPart(descriptionSourceSection);
-
+
}
destroySections();
DescriptionDetailSection descriptionDetailSection = (DescriptionDetailSection) formFactory
.createCdmDetailSection(DetailType.DESCRIPTION,
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.EXPANDED);
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
addPart(descriptionDetailSection);
}
-
+
/**
* createMediaElementSection
* @param parent
destroySections();
MediaDetailsSection mediaDetailSection = (MediaDetailsSection) formFactory
.createCdmDetailSection(DetailType.MEDIA,
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.EXPANDED);
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
addPart(mediaDetailSection);
}
* createDerivedUnitBaseElementSection
* @param parent
*/
- private void createDerivedUnitBaseElementSection(RootElement parent) {
- destroySections();
-
- GeneralDetailSection generalDetailSection = (GeneralDetailSection) formFactory
- .createCdmDetailSection(DetailType.DERIVED_UNIT_GENERAL,
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.EXPANDED);
+ private void createDerivedUnitBaseElementSection(RootElement parent) {
+ destroySections();
+
+ GeneralDetailSection generalDetailSection = (GeneralDetailSection) formFactory.createCdmDetailSection(DetailType.DERIVED_UNIT_GENERAL, getConversationHolder(), parent, this, ExpandableComposite.TWISTIE| ExpandableComposite.EXPANDED);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- GatheringEventDetailSection gatheringEventDetailSection = (GatheringEventDetailSection) formFactory
- .createCdmDetailSection(DetailType.GATHERING_EVENT,
- getConversationHolder(), parent, this, Section.TWISTIE);
+ GatheringEventDetailSection gatheringEventDetailSection = (GatheringEventDetailSection) formFactory.createCdmDetailSection(DetailType.GATHERING_EVENT, getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- FieldObservationDetailSection fieldObservationDetailSection = (FieldObservationDetailSection) formFactory
- .createCdmDetailSection(DetailType.FIELD_OBSERVATION,
- getConversationHolder(), parent, this, Section.TWISTIE);
+ FieldObservationDetailSection fieldObservationDetailSection = (FieldObservationDetailSection) formFactory.createCdmDetailSection(DetailType.FIELD_OBSERVATION, getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = (DerivedUnitBaseDetailSection) formFactory
- .createCdmDetailSection(DetailType.DERIVED_UNIT,
- getConversationHolder(), parent, this, Section.TWISTIE);
+ DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = (DerivedUnitBaseDetailSection) formFactory.createCdmDetailSection(DetailType.DERIVED_UNIT, getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- DeterminationDetailSection determinationDetailSection = (DeterminationDetailSection) formFactory
- .createCdmDetailSection(DetailType.DETERMINATION,
- getConversationHolder(), parent, this, Section.TWISTIE);
+ DeterminationDetailSection determinationDetailSection = (DeterminationDetailSection) formFactory.createCdmDetailSection(DetailType.DETERMINATION, getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
- addPart(generalDetailSection);
- addPart(gatheringEventDetailSection);
- addPart(fieldObservationDetailSection);
- addPart(derivedUnitBaseDetailSection);
- addPart(determinationDetailSection);
+ addPart(generalDetailSection);
+ addPart(gatheringEventDetailSection);
+ addPart(fieldObservationDetailSection);
+ addPart(derivedUnitBaseDetailSection);
+ addPart(determinationDetailSection);
- }
+ }
/**
* @param rootElement
FeatureDistributionDetailSection featureDistributionSection = (FeatureDistributionDetailSection) formFactory
.createCdmDetailSection(DetailType.FEATURE_DISTRIBUTION,
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.EXPANDED);
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
addPart(featureDistributionSection);
}
- private void createPolytomousKeySection(RootElement parent) {
- destroySections();
-
- PolytomousKeyDetailSection polytomousKeyDetailSection = (PolytomousKeyDetailSection) formFactory
- .createCdmDetailSection(DetailType.POLYTOMOUS_KEY,
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.EXPANDED);
-
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
- GeographicalScopeDetailSection geographicalScopeDetailSection = (GeographicalScopeDetailSection) formFactory
- .createEntityDetailSection(EntityDetailType.GEOGRAPHICAL_SCOPE,
- getConversationHolder(), parent, Section.TWISTIE);
-
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
- ScopeRestrictionSection scopeRestrictionSection = (ScopeRestrictionSection) formFactory
- .createEntityDetailSection(EntityDetailType.SCOPE_RESTRICTION,
- getConversationHolder(), parent, Section.TWISTIE);
-
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
- TaxonomicScopeSection taxonomicScopeSection = (TaxonomicScopeSection) formFactory
- .createEntityDetailSection(EntityDetailType.TAXONOMIC_SCOPE,
- getConversationHolder(), parent, Section.TWISTIE);
-
- addPart(polytomousKeyDetailSection);
- addPart(geographicalScopeDetailSection);
- addPart(scopeRestrictionSection);
- addPart(taxonomicScopeSection);
- }
-
/**
* createPolytomousKeyNodeSection
* @param parent
PolytomousKeyDetailSection polytomousKeyDetailSection = (PolytomousKeyDetailSection) formFactory
.createCdmDetailSection(DetailType.POLYTOMOUS_KEY,
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.COMPACT);
-
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
+ | ExpandableComposite.COMPACT);
+
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
+
PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection = (PolytomousKeyNodeDetailSection) formFactory
.createCdmDetailSection(DetailType.POLYTOMOUS_KEY_NODE,
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.EXPANDED);
-
-// formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-//
-// GeographicalScopeDetailSection geographicalScopeDetailSection = (GeographicalScopeDetailSection) formFactory
-// .createEntityDetailSection(EntityDetailType.GEOGRAPHICAL_SCOPE,
-// getConversationHolder(), parent, Section.TWISTIE | Section.COMPACT);
-//
-// formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-//
-// ScopeRestrictionSection scopeRestrictionSection = (ScopeRestrictionSection) formFactory
-// .createEntityDetailSection(EntityDetailType.SCOPE_RESTRICTION,
-// getConversationHolder(), parent, Section.TWISTIE | Section.COMPACT);
-//
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
+
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
TaxonomicScopeSection taxonomicScopeSection = (TaxonomicScopeSection) formFactory
.createEntityDetailSection(EntityDetailType.TAXONOMIC_SCOPE,
- getConversationHolder(), parent, Section.TWISTIE | Section.COMPACT);
+ getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.COMPACT);
addPart(polytomousKeyDetailSection);
addPart(polytomousKeyNodeDetailSection);
-// addPart(geographicalScopeDetailSection);
-// addPart(scopeRestrictionSection);
addPart(taxonomicScopeSection);
}
-
+
/**
* create the UseRecordSection
* @param parent
UseRecordDetailSection descriptionUseRecordSection = (UseRecordDetailSection) formFactory
.createCdmDetailSection(DetailType.USE_RECORD,
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.EXPANDED);
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
+
addPart(descriptionUseRecordSection);
-
-
+
+
}
/**
UserDetailSection userDetailSection = (UserDetailSection) formFactory
.createCdmDetailSection(DetailType.USER,
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.EXPANDED);
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
GroupsByUserDetailSection groupByUserDetailSection = (GroupsByUserDetailSection) formFactory
.createEntityDetailSection(EntityDetailType.GROUPS_BY_USER,
- getConversationHolder(), parent, Section.TWISTIE
- | Section.EXPANDED);
+ getConversationHolder(), parent, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
addPart(userDetailSection);
addPart(groupByUserDetailSection);
TaxonRelationshipDetailSection taxonRelationshipDetailSection = (TaxonRelationshipDetailSection) formFactory
.createCdmDetailSection(DetailType.TAXON_RELATIONSHIP,
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.EXPANDED);
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
ReferencedEntityDetailSection referencedEntityBaseDetailSection = (ReferencedEntityDetailSection) formFactory
.createCdmDetailSection(DetailType.REFERENCED_ENTITY,
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.EXPANDED);
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
addPart(taxonRelationshipDetailSection);
addPart(referencedEntityBaseDetailSection);
}
TermVocabularyDetailSection termVocabularyDetailSection = (TermVocabularyDetailSection) formFactory
.createCdmDetailSection(DetailType.TERM_VOCABULARY,
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.EXPANDED);
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
addPart(termVocabularyDetailSection);
}
AbstractFormSection definedTermDetailSection = formFactory
.createDefinedTermDetailSection(getInput().getClass(),
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.EXPANDED);
+ getConversationHolder(), parent, this, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
addPart(definedTermDetailSection);
}
}