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
.section
.supplemental
;
13 import java
.util
.Collection
;
15 import org
.apache
.log4j
.Logger
;
17 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
18 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
19 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentation
;
20 import eu
.etaxonomy
.taxeditor
.forms
.CdmFormFactory
;
21 import eu
.etaxonomy
.taxeditor
.forms
.ICdmFormElement
;
22 import eu
.etaxonomy
.taxeditor
.section
.AbstractEntityCollectionSection
;
25 * <p>MediaRepresentationSection class.</p>
28 * @created Mar 24, 2010
31 public class MediaRepresentationSection
extends AbstractEntityCollectionSection
<Media
, MediaRepresentation
> {
33 private static final Logger logger
= Logger
34 .getLogger(MediaRepresentationSection
.class);
37 * <p>Constructor for MediaRepresentationSection.</p>
39 * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.forms.CdmFormFactory} object.
40 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
41 * @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object.
44 public MediaRepresentationSection(CdmFormFactory cdmFormFactory
, ConversationHolder conversation
,
45 ICdmFormElement parentElement
, int style
) {
46 super(cdmFormFactory
, conversation
, parentElement
, "Media Representation", style
);
51 public void addElement(MediaRepresentation element
) {
52 getEntity().addRepresentation(element
);
57 public MediaRepresentation
createNewElement() {
58 return MediaRepresentation
.NewInstance();
63 public Collection
<MediaRepresentation
> getCollection(
65 return getEntity().getRepresentations();
70 public String
getEmptyString() {
71 return "No media representations yet.";
76 protected String
getTooltipString() {
77 return "Create a new media representation";
82 public void removeElement(MediaRepresentation element
) {
83 getEntity().removeRepresentation(element
);