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
.description
;
13 import org
.apache
.log4j
.Logger
;
14 import org
.eclipse
.jface
.viewers
.ISelectionProvider
;
15 import org
.eclipse
.ui
.forms
.widgets
.Section
;
16 import org
.eclipse
.ui
.forms
.widgets
.TableWrapLayout
;
18 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
19 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
20 import eu
.etaxonomy
.taxeditor
.forms
.CdmFormFactory
;
21 import eu
.etaxonomy
.taxeditor
.forms
.ICdmFormElement
;
22 import eu
.etaxonomy
.taxeditor
.forms
.CdmFormFactory
.DetailType
;
23 import eu
.etaxonomy
.taxeditor
.section
.AbstractCdmDetailSection
;
24 import eu
.etaxonomy
.taxeditor
.section
.supplemental
.MediaElement
;
27 * <p>MediaDetailsSection class.</p>
30 * @created Jun 15, 2010
33 public class MediaDetailsSection
extends AbstractCdmDetailSection
<Media
> {
36 private static final Logger logger
= Logger
37 .getLogger(MediaDetailsSection
.class);
38 private MediaElement element_media
;
41 * <p>Constructor for MediaDetailsSection.</p>
43 * @param formFactory a {@link eu.etaxonomy.taxeditor.forms.CdmFormFactory} object.
44 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
45 * @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object.
46 * @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
49 public MediaDetailsSection(CdmFormFactory formFactory
, ConversationHolder conversation
,
50 ICdmFormElement parentElement
,
51 ISelectionProvider selectionProvider
, int style
) {
52 super(formFactory
, conversation
, parentElement
, selectionProvider
, style
);
56 * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType()
60 protected DetailType
getDetailType() {
66 protected void createControls(AbstractCdmDetailSection formElement
,
68 TableWrapLayout layout
= (TableWrapLayout
) getLayoutComposite().getLayout();
69 layout
.topMargin
= 10;
70 layout
.numColumns
= 2;
72 getLayoutComposite().setLayout(layout
);
80 * @param entity a {@link eu.etaxonomy.cdm.model.media.Media} object.
82 public void setEntity(Media entity
) {
83 if(element_media
!= null){
84 this.removeElements();
86 element_media
= (MediaElement
) formFactory
.createEntityCollectionElement(this, entity
, null, null, Section
.EXPANDED
);
87 formFactory
.addPropertyChangeListener(element_media
);
88 super.setEntity(entity
);
94 * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
98 public String
getHeading() {