From 6a9dd32f15a4b59e7badc8b1c83cba2ea704042d Mon Sep 17 00:00:00 2001 From: Patric Plitzner
* Abstract AbstractFormSection class. *
- * + * * @author n.hoffmann * @created Feb 22, 2010 * @version 1.0 @@ -53,7 +53,7 @@ public abstract class AbstractFormSection* Constructor for AbstractFormSection. *
- * + * * @param conversation * TODO * @param style @@ -107,7 +107,7 @@ public abstract class AbstractFormSection* Constructor for AbstractFormSection. *
- * + * * @param formFactory * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} * object. @@ -133,15 +133,17 @@ public abstract class AbstractFormSection
* Getter for the field propertyChangeListeners
.
*
* Setter for the field entity
.
*
* Getter for the field entity
.
*
* getToggle *
- * + * * @return a {@link org.eclipse.ui.forms.widgets.ToggleHyperlink} object. */ public ToggleHyperlink getToggle() { @@ -189,7 +192,7 @@ public abstract class AbstractFormSection* getSection *
- * + * * @return a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection} * object. */ @@ -199,13 +202,14 @@ public abstract class AbstractFormSection* widgetSelected *
- * + * * @param e * a {@link org.eclipse.swt.events.SelectionEvent} object. */ @@ -335,7 +340,8 @@ public abstract class AbstractFormSection* addSelectionListener *
- * + * * @param listener * a {@link org.eclipse.swt.events.SelectionListener} object. */ @@ -377,7 +384,7 @@ public abstract class AbstractFormSection* removeSelectionListener *
- * + * * @param listener * a {@link org.eclipse.swt.events.SelectionListener} object. */ @@ -386,7 +393,8 @@ public abstract class AbstractFormSection* removeElement *
- * + * * @param element * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} * object. @@ -408,7 +416,8 @@ public abstract class AbstractFormSection
* Getter for the field parentElement
.
*
* Getter for the field elements
.
*
* getControls *
- * + * * @return a {@link java.util.Set} object. */ - public Set* getLayoutComposite *
- * + * * @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 { @@ -519,7 +533,7 @@ public abstract class AbstractFormSection
* Getter for the field formFactory
.
*
* getConversationHolder *
- * + * * @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(); @@ -560,15 +576,16 @@ public abstract class AbstractFormSection* CdmFormFactory class. *
- * + * * @author n.hoffmann * @created Feb 24, 2010 * @version 1.0 @@ -280,9 +280,9 @@ public class CdmFormFactory extends FormToolkit { return true; } }; - + /** - * + * * @author n.hoffmann * @date Jan 25, 2010 * @@ -295,7 +295,7 @@ public class CdmFormFactory extends FormToolkit { } /** - * + * * @author n.hoffmann * @date Jan 25, 2010 * @@ -321,7 +321,7 @@ public class CdmFormFactory extends FormToolkit { ** Constructor for CdmFormFactory. *
- * + * * @param display * a {@link org.eclipse.swt.widgets.Display} object. * @param selectionProvider @@ -337,7 +337,7 @@ public class CdmFormFactory extends FormToolkit { ** Constructor for CdmFormFactory. *
- * + * * @param display * a {@link org.eclipse.swt.widgets.Display} object. */ @@ -347,7 +347,7 @@ public class CdmFormFactory extends FormToolkit { } /** - * + * */ private void init() { boldFontHolder2 = new BoldFontHolder2(); @@ -357,10 +357,10 @@ public class CdmFormFactory extends FormToolkit { /** * 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. @@ -381,7 +381,7 @@ public class CdmFormFactory extends FormToolkit { ** destroySelectionArbitrator *
- * + * * @param selectionArbitrator * a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator} * object. @@ -409,9 +409,10 @@ public class CdmFormFactory extends FormToolkit { /** *
- * adapt
+ * Adapts the {@link AbstractCdmFormElement}:
+ * - sets the {@link IPropertyChangeListener}s handled by this class
*
* destroyElement *
- * + * * @param formElement * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} * object. @@ -476,7 +477,7 @@ public class CdmFormFactory extends FormToolkit { ** createEmptyCell *
- * + * * @param parent * a {@link org.eclipse.swt.widgets.Composite} object. * @return a {@link org.eclipse.swt.widgets.Label} object. @@ -489,7 +490,7 @@ public class CdmFormFactory extends FormToolkit { ** createMultilineTextWithLabel *
- * + * * @param labelString * a {@link java.lang.String} object. * @param textHeight @@ -516,7 +517,7 @@ public class CdmFormFactory extends FormToolkit { ** createMultiLanguageTextElement *
- * + * * @param parentElement * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} * object. @@ -558,7 +559,7 @@ public class CdmFormFactory extends FormToolkit { ** createTextWithLabelElement *
- * + * * @param labelString * a {@link java.lang.String} object. * @param initialText @@ -609,7 +610,7 @@ public class CdmFormFactory extends FormToolkit { } /** - * + * * @param parentElement * @param labelString * @param conversationEnabled @@ -631,7 +632,7 @@ public class CdmFormFactory extends FormToolkit { ** createIntegerTextWithLabelElement *
- * + * * @param parentElement * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} * object. @@ -658,7 +659,7 @@ public class CdmFormFactory extends FormToolkit { ** createFloatTextWithLabelElement *
- * + * * @param parentElement * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} * object. @@ -685,7 +686,7 @@ public class CdmFormFactory extends FormToolkit { ** createLanguageStringWithLabelElement *
- * + * * @param parentElement * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} * object. @@ -713,7 +714,7 @@ public class CdmFormFactory extends FormToolkit { ** createLanguageStringWithLabelElement *
- * + * * @param parentElement * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} * object. @@ -743,7 +744,7 @@ public class CdmFormFactory extends FormToolkit { ** createTextElement *
- * + * * @param parentElement * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} * object. @@ -767,7 +768,7 @@ public class CdmFormFactory extends FormToolkit { ** createKeyValueViewerElement *
- * + * * @param parentElement * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} * object. @@ -794,7 +795,7 @@ public class CdmFormFactory extends FormToolkit { ** createTermComboElement *
- * + * * @param termComboType * a * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.TermComboType} @@ -812,7 +813,7 @@ public class CdmFormFactory extends FormToolkit { * @return a {@link eu.etaxonomy.taxeditor.ui.combo.TermComboElement} * object. */ - + public* createEnumComboElement *
- * + * * @param enumComboType * a * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EnumComboType} @@ -852,7 +853,7 @@ public class CdmFormFactory extends FormToolkit { ** createBrowserElement *
- * + * * @param imageUri * a {@link java.net.URI} object. * @param style @@ -875,7 +876,7 @@ public class CdmFormFactory extends FormToolkit { ** createImageElement *
- * + * * @param parentElement * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} * object. @@ -898,7 +899,7 @@ public class CdmFormFactory extends FormToolkit { ** createTextActionElement *
- * + * * @param labelString * a {@link java.lang.String} object. * @param initialText @@ -927,7 +928,7 @@ public class CdmFormFactory extends FormToolkit { ** createCheckbox *
- * + * * @param parentElement * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} * object. @@ -950,7 +951,7 @@ public class CdmFormFactory extends FormToolkit { /** * Creates a section as a part of the form. - * + * * @return the section widget * @param section * a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection} @@ -1025,7 +1026,7 @@ public class CdmFormFactory extends FormToolkit { ** createToggleableTextField *
- * + * * @param parentElement * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} * object. @@ -1055,7 +1056,7 @@ public class CdmFormFactory extends FormToolkit { ** createTimePeriodElement *
- * + * * @param parentElement * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} * object. @@ -1082,7 +1083,7 @@ public class CdmFormFactory extends FormToolkit { ** createPointElement *
- * + * * @param style * a int. * @param parentElement @@ -1105,7 +1106,7 @@ public class CdmFormFactory extends FormToolkit { ** createDateDetailSection *
- * + * * @param parentElement * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} * object. @@ -1127,7 +1128,7 @@ public class CdmFormFactory extends FormToolkit { ** createPartialElement *
- * + * * @param parentElement * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} * object. @@ -1152,7 +1153,7 @@ public class CdmFormFactory extends FormToolkit { ** addSelectionListener *
- * + * * @param listener * a {@link org.eclipse.swt.events.SelectionListener} object. */ @@ -1164,7 +1165,7 @@ public class CdmFormFactory extends FormToolkit { ** removeSelectionListener *
- * + * * @param listener * a {@link org.eclipse.swt.events.SelectionListener} object. */ @@ -1183,7 +1184,7 @@ public class CdmFormFactory extends FormToolkit { ** addPropertyChangeListener *
- * + * * @param listener * a {@link org.eclipse.jface.util.IPropertyChangeListener} * object. @@ -1199,7 +1200,7 @@ public class CdmFormFactory extends FormToolkit { ** removePropertyChangeListener *
- * + * * @param listener * a {@link org.eclipse.jface.util.IPropertyChangeListener} * object. @@ -1212,7 +1213,7 @@ public class CdmFormFactory extends FormToolkit { ** createHorizontalSeparator *
- * + * * @param parentElement * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} * object. @@ -1232,7 +1233,7 @@ public class CdmFormFactory extends FormToolkit { ** createVersionElement *
- * + * * @param parentElement * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} * object. @@ -1253,7 +1254,7 @@ public class CdmFormFactory extends FormToolkit { parentElement.addElement(element); return element; } - + /** * @param cdmBaseSection * @param object @@ -1274,7 +1275,7 @@ public class CdmFormFactory extends FormToolkit { ** createVersionSection *
- * + * * @param parentElement * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} * object. @@ -1291,7 +1292,7 @@ public class CdmFormFactory extends FormToolkit { adapt(section); return section; } - + /** * @param parent * @param i @@ -1308,7 +1309,7 @@ public class CdmFormFactory extends FormToolkit { ** createEmptyElement *
- * + * * @param parentElement * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} * object. @@ -1326,7 +1327,7 @@ public class CdmFormFactory extends FormToolkit { ** createHeadlineSection *
- * + * * @param parentElement * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} * object. @@ -1346,7 +1347,7 @@ public class CdmFormFactory extends FormToolkit { ** createParsingMessageElement *
- * + * * @param parentElement * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} * object. @@ -1372,61 +1373,61 @@ public class CdmFormFactory extends FormToolkit { // 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 @@ -1437,14 +1438,14 @@ public class CdmFormFactory extends FormToolkit { 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; @@ -1454,7 +1455,7 @@ public class CdmFormFactory extends FormToolkit { ** createCdmDetailSection *
- * + * * @param detailType * a * {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType} @@ -1595,19 +1596,19 @@ public class CdmFormFactory extends FormToolkit { 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: @@ -1615,7 +1616,7 @@ public class CdmFormFactory extends FormToolkit { selectionProvider, style); break; } - + if (section == null) { throw new RuntimeException( @@ -1627,13 +1628,13 @@ public class CdmFormFactory extends FormToolkit { return section; } - - + + /** ** createCdmDetailElement *
- * + * * @param detailType * a * {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType} @@ -1772,46 +1773,46 @@ public class CdmFormFactory extends FormToolkit { } /** - * + * * @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 } @@ -1819,7 +1820,7 @@ public class CdmFormFactory extends FormToolkit { ** createEntityDetailSection *
- * + * * @param entityDetailType * a * {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType} @@ -1835,13 +1836,12 @@ public class CdmFormFactory extends FormToolkit { * @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; @@ -1985,7 +1985,7 @@ public class CdmFormFactory extends FormToolkit { ** createEntityCollectionElement *
- * + * * @param removeListener * a {@link org.eclipse.swt.events.SelectionListener} object. * @param style @@ -2034,8 +2034,8 @@ public class CdmFormFactory extends FormToolkit { 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); @@ -2136,9 +2136,9 @@ public class CdmFormFactory extends FormToolkit { *
* Getter for the field selectionProvider
.
*
* createDetailedDescriptionDetailElement *
- * + * * @param parentElement * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} * object. @@ -2263,7 +2263,7 @@ public class CdmFormFactory extends FormToolkit { /** * Creates a styled text as a part of the form. - * + * * @param parent * the text parent * @param value @@ -2275,8 +2275,9 @@ public class CdmFormFactory extends FormToolkit { 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); diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitFacadeDetailElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitFacadeDetailElement.java index 937ee2113..3997d2af3 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitFacadeDetailElement.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitFacadeDetailElement.java @@ -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. */ @@ -32,7 +32,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection; * @version 1.0 */ public class DerivedUnitFacadeDetailElement extends AbstractCdmDetailElementfacade
.
*
@@ -113,27 +113,27 @@ public class DerivedUnitFacadeDetailElement extends AbstractCdmDetailElementConstructor for FieldObservationDetailElement.
* @@ -54,7 +51,7 @@ public class FieldObservationDetailElement extends AbstractCdmDetailElement* Constructor for GatheringEventDetailElement. *
- * + * * @param formFactory * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} * object. @@ -68,49 +68,33 @@ public class GatheringEventDetailElement extends 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 @@ -128,7 +112,7 @@ public class GatheringEventDetailElement extends } 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 { @@ -140,7 +124,7 @@ public class GatheringEventDetailElement extends } 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()); diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeneralDetailElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeneralDetailElement.java index 30f43dd00..8ad652623 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeneralDetailElement.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeneralDetailElement.java @@ -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. */ @@ -14,7 +14,6 @@ import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade; 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; @@ -43,8 +42,8 @@ public class GeneralDetailElement extends private TimePeriodElement element_date; private EntitySelectionElementConstructor for AbstractCdmDataViewer.
* @@ -61,9 +61,9 @@ public abstract class AbstractCdmDataViewer extends Viewer implements ISelection */ public AbstractCdmDataViewer(Composite parent, AbstractCdmViewPart viewPart) { this.viewPart = viewPart; - + managedForm = new ManagedForm(parent){ - + /* (non-Javadoc) * @see org.eclipse.ui.forms.ManagedForm#dirtyStateChanged() */ @@ -72,18 +72,18 @@ public abstract class AbstractCdmDataViewer extends Viewer implements ISelection markViewPartDirty(); } }; - + createFormFactory(); - + scrolledForm = managedForm.getForm(); - + body = scrolledForm.getBody(); - + body.setLayout(LayoutConstants.LAYOUT()); - + rootElement = new RootElement(formFactory, body); } - + /** *createFormFactory
*/ @@ -98,8 +98,8 @@ public abstract class AbstractCdmDataViewer extends Viewer implements ISelection protected void markViewPartDirty(){ viewPart.changed(input); } - - + + /** * @return */ @@ -116,22 +116,22 @@ public abstract class AbstractCdmDataViewer extends Viewer implements ISelection 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() */ @@ -140,7 +140,7 @@ public abstract class AbstractCdmDataViewer extends Viewer implements ISelection public Object getInput() { return input; } - + /* (non-Javadoc) * @see org.eclipse.jface.viewers.Viewer#refresh() */ @@ -148,51 +148,51 @@ public abstract class AbstractCdmDataViewer extends Viewer implements ISelection @Override public void refresh() { showParts(); - + managedForm.setInput(input); - + managedForm.refresh(); - + managedForm.reflow(true); } - + /** *layout
*/ public void layout(){ body.layout(); } - + /** *showParts
*/ protected abstract void showParts(); - - + + /** *destroySections
*/ - 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; } } - - + + /** *setFocus
*/ @@ -205,14 +205,14 @@ public abstract class AbstractCdmDataViewer extends Viewer implements ISelection break; } } - + /** *reflow
*/ public void reflow(){ managedForm.reflow(true); } - + /** *removePart
* @@ -222,7 +222,7 @@ public abstract class AbstractCdmDataViewer extends Viewer implements ISelection managedForm.removePart(sectionPart); formFactory.removePropertyChangeListener(sectionPart); } - + /** *addPart
* @@ -233,17 +233,19 @@ public abstract class AbstractCdmDataViewer extends Viewer implements ISelection managedForm.addPart(sectionPart); formFactory.addPropertyChangeListener(sectionPart); } - + /** *getConversationHolder
* * @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) {} } diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java index ac6c878be..169895ef5 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java @@ -2,9 +2,9 @@ // $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. */ @@ -17,7 +17,7 @@ import org.eclipse.jface.viewers.ISelection; 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; @@ -39,16 +39,17 @@ import eu.etaxonomy.cdm.model.description.PolytomousKeyNode; 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; @@ -70,10 +71,8 @@ import eu.etaxonomy.taxeditor.ui.section.feature.FeatureDistributionDetailSectio 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; @@ -101,7 +100,7 @@ import eu.etaxonomy.taxeditor.view.AbstractCdmViewPart; ** DetailsViewer class. *
- * + * * @author n.hoffmann * @created Feb 12, 2010 * @version 1.0 @@ -114,7 +113,7 @@ public class DetailsViewer extends AbstractCdmDataViewer { ** Constructor for DetailsViewer. *
- * + * * @param parent * a {@link org.eclipse.swt.widgets.Composite} object. * @param viewPart @@ -132,7 +131,7 @@ public class DetailsViewer extends AbstractCdmDataViewer { /* * (non-Javadoc) - * + * * @see * eu.etaxonomy.taxeditor.editor.view.AbstractCdmDataViewer#setInput(java * .lang.Object) @@ -141,10 +140,9 @@ public class DetailsViewer extends AbstractCdmDataViewer { 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); @@ -164,7 +162,7 @@ public class DetailsViewer extends AbstractCdmDataViewer { /* * (non-Javadoc) - * + * * @see org.eclipse.jface.viewers.Viewer#refresh() */ /** {@inheritDoc} */ @@ -174,26 +172,27 @@ public class DetailsViewer extends AbstractCdmDataViewer { // 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