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