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
.media
;
12 import java
.util
.Collection
;
14 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
15 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
16 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentation
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
19 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionSection
;
22 * <p>MediaRepresentationSection class.</p>
25 * @created Mar 24, 2010
28 public class MediaRepresentationSection
extends AbstractEntityCollectionSection
<Media
, MediaRepresentation
> {
31 * <p>Constructor for MediaRepresentationSection.</p>
33 * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
34 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
35 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
38 public MediaRepresentationSection(CdmFormFactory cdmFormFactory
, ConversationHolder conversation
,
39 ICdmFormElement parentElement
, int style
) {
40 super(cdmFormFactory
, conversation
, parentElement
, "Media Representation", style
);
45 public void addElement(MediaRepresentation element
) {
46 getEntity().addRepresentation(element
);
51 public MediaRepresentation
createNewElement() {
52 return MediaRepresentation
.NewInstance();
57 public Collection
<MediaRepresentation
> getCollection(
59 return getEntity().getRepresentations();
64 public String
getEmptyString() {
65 return "No media representations yet.";
70 protected String
getTooltipString() {
71 return "Create a new media representation";
76 public void removeElement(MediaRepresentation element
) {
77 getEntity().removeRepresentation(element
);