X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/blobdiff_plain/e3240965ccd65c0d123d05e13d04e7820fe01f85..HEAD:/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/TimePeriodElement.java diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/TimePeriodElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/TimePeriodElement.java index 5acb8b5aa..141ca94a0 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/TimePeriodElement.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/TimePeriodElement.java @@ -1,142 +1,57 @@ /** * 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.element; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.forms.widgets.Section; +import org.eclipse.ui.forms.widgets.ExpandableComposite; import eu.etaxonomy.cdm.model.common.TimePeriod; /** - *
* TimePeriodElement class. - *
- * + * * @author n.hoffmann * @created Nov 17, 2009 - * @version 1.0 */ -public class TimePeriodElement extends AbstractCdmFormElement implements ISelectable { - - private TimePeriod timePeriod; - private final Label label; - private final DateDetailSection section_dateDetails; - - /** - *- * Constructor for TimePeriodElement. - *
- * - * @param style - * a int. - * @param formFactory - * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} - * object. - * @param parentElement - * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} - * object. - * @param labelString - * a {@link java.lang.String} object. - * @param timePeriod - * a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object. - */ - public TimePeriodElement(CdmFormFactory formFactory, - ICdmFormElement parentElement, String labelString, - TimePeriod timePeriod, final int style) { - super(formFactory, parentElement); - - label = formFactory.createLabel(getLayoutComposite(), labelString); - addControl(label); - - section_dateDetails = formFactory.createDateDetailSection(this, - Section.TWISTIE); - addControl(section_dateDetails); - - setTimePeriod(timePeriod); +public class TimePeriodElement + extends TimePeriodElementBase- * setEntity - *
- * - * @param timePeriod - * a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object. - */ - public void setEntity(TimePeriod timePeriod) { - setTimePeriod(timePeriod); - } - - /** {@inheritDoc} */ @Override - public void propertyChange(PropertyChangeEvent event) { - if (event == null) { - return; - } - Object eventSource = event.getSource(); - - if (getElements().contains(eventSource)) { - handleEvent(eventSource); - } - } - - private void handleEvent(Object eventSource) { - if (eventSource == section_dateDetails) { - timePeriod = section_dateDetails.getEntity(); - firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null)); - } - } - - /** - *
- * Setter for the field timePeriod
.
- *
- * Getter for the field timePeriod
.
- *