3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
11 package eu
.etaxonomy
.taxeditor
.ui
.section
.agent
;
13 import org
.eclipse
.jface
.viewers
.ISelectionProvider
;
15 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
16 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
17 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
18 import eu
.etaxonomy
.cdm
.model
.agent
.TeamOrPersonBase
;
19 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
20 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
21 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
22 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
23 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailSection
;
26 * <p>TeamOrPersonBaseDetailSection class.</p>
29 * @created Apr 26, 2010
32 public class TeamOrPersonBaseDetailSection
extends AbstractCdmDetailSection
<TeamOrPersonBase
> {
35 * <p>Constructor for TeamOrPersonBaseDetailSection.</p>
37 * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
38 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
39 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
40 * @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
43 public TeamOrPersonBaseDetailSection(CdmFormFactory cdmFormFactory
, ConversationHolder conversation
,
44 ICdmFormElement parentElement
, ISelectionProvider selectionProvider
, int style
) {
45 super(cdmFormFactory
, conversation
, parentElement
, selectionProvider
, style
);
50 public String
getHeading() {
51 if (getEntity() != null){
52 if(getEntity() instanceof Team
){
54 }else if (getEntity().getClass().isAssignableFrom(Person
.class)){
58 return "Team or Person";
62 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
65 protected AbstractCdmDetailElement
<TeamOrPersonBase
> createCdmDetailElement(AbstractCdmDetailSection
<TeamOrPersonBase
> parentElement
, int style
) {
66 MessagingUtils
.error(this.getClass(), "Detail element was not created. Seems like the case was not implemented for TeamOrPersonBaseDetailSection", null);
67 //TODO DetailElement missing??