-// $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.agent;
import eu.etaxonomy.cdm.model.agent.Institution;
-import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
/**
* @author n.hoffmann
* @created Dec 15, 2010
- * @version 1.0
*/
public class InstitutionDetailElement extends
AbstractCdmDetailElement<Institution> {
private EntitySelectionElement<Institution> selection_partOfInstitution;
- /**
- * @param formFactory
- * @param formElement
- */
public InstitutionDetailElement(CdmFormFactory formFactory,
ICdmFormElement formElement) {
super(formFactory, formElement);
}
- /*
- * (non-Javadoc)
- *
- * @see
- * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls
- * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, java.lang.Object, int)
- */
@Override
protected void createControls(ICdmFormElement formElement,
Institution entity, int style) {
+ this.setWarnForReferencingObjects(formElement);
+
text_name = formFactory.createTextWithLabelElement(formElement, "Name",
entity.getName(), style);
text_code = formFactory.createTextWithLabelElement(formElement, "Code",
// section_institutionTypes
selection_partOfInstitution = formFactory
.createSelectionElement(Institution.class,
- getConversationHolder(), formElement, "Is Part Of",
+ formElement, "Is Part Of",
entity.getIsPartOf(),
- EntitySelectionElement.EDITABLE | EntitySelectionElement.SELECTABLE | EntitySelectionElement.DELETABLE,
+ EntitySelectionElement.EDITABLE | EntitySelectionElement.SELECTABLE | EntitySelectionElement.DELETABLE,
style);
}
- /*
- * (non-Javadoc)
- *
- * @see
- * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
- * .lang.Object)
- */
@Override
public void handleEvent(Object eventSource) {
if (eventSource == text_name) {
}
}
-}
+ @Override
+ public void fillFields() {
+ if (getEntity() != null) {
+ text_name.setText(getEntity().getName());
+ text_code.setText(getEntity().getCode());
+ selection_partOfInstitution.setEntity(getEntity().getIsPartOf());
+ }
+
+ }
+}
\ No newline at end of file