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
.media
;
13 import java
.util
.Collection
;
15 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
16 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
17 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentation
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
20 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionSection
;
23 * <p>MediaRepresentationSection class.</p>
26 * @created Mar 24, 2010
29 public class MediaRepresentationSection
extends AbstractEntityCollectionSection
<Media
, MediaRepresentation
> {
32 * <p>Constructor for MediaRepresentationSection.</p>
34 * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
35 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
36 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
39 public MediaRepresentationSection(CdmFormFactory cdmFormFactory
, ConversationHolder conversation
,
40 ICdmFormElement parentElement
, int style
) {
41 super(cdmFormFactory
, conversation
, parentElement
, "Media Representation", style
);
46 public void addElement(MediaRepresentation element
) {
47 getEntity().addRepresentation(element
);
52 public MediaRepresentation
createNewElement() {
53 return MediaRepresentation
.NewInstance();
58 public Collection
<MediaRepresentation
> getCollection(
60 return getEntity().getRepresentations();
65 public String
getEmptyString() {
66 return "No media representations yet.";
71 protected String
getTooltipString() {
72 return "Create a new media representation";
77 public void removeElement(MediaRepresentation element
) {
78 getEntity().removeRepresentation(element
);