X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/blobdiff_plain/23783f7af11e37d8388c85e026da3700ff41ef8d..2ebeb1a9fbadc077a5e73c2563e60c73927cd40f:/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/MediaDetailsSection.java diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/MediaDetailsSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/MediaDetailsSection.java index f82b59c3c..54a0345fd 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/MediaDetailsSection.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/MediaDetailsSection.java @@ -1,9 +1,8 @@ -// $Id$ /** * Copyright (C) 2007 EDIT -* European Distributed Institute of Taxonomy +* European Distributed Institute of Taxonomy * http://www.e-taxonomy.eu -* +* * The contents of this file are subject to the Mozilla Public License Version 1.1 * See LICENSE.TXT at the top of this package for the full license terms. */ @@ -11,16 +10,15 @@ package eu.etaxonomy.taxeditor.ui.section.description; import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.ui.forms.widgets.Section; -import org.eclipse.ui.forms.widgets.TableWrapLayout; +import org.eclipse.ui.forms.widgets.ExpandableComposite; import eu.etaxonomy.cdm.api.conversation.ConversationHolder; import eu.etaxonomy.cdm.model.media.Media; import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; -import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType; import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; +import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement; import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection; -import eu.etaxonomy.taxeditor.ui.section.media.MediaElement; +import eu.etaxonomy.taxeditor.ui.section.media.MediaMetaElement; /** *
MediaDetailsSection class.
@@ -31,67 +29,34 @@ import eu.etaxonomy.taxeditor.ui.section.media.MediaElement; */ public class MediaDetailsSection extends AbstractCdmDetailSectionConstructor for MediaDetailsSection.
- * - * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object. - * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object. - * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object. - * @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object. - * @param style a int. - */ public MediaDetailsSection(CdmFormFactory formFactory, ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) { super(formFactory, conversation, parentElement, selectionProvider, style); } - - /* (non-Javadoc) - * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getDetailType() - */ - /** {@inheritDoc} */ - @Override - protected DetailType getDetailType() { - return null; - } - - /** {@inheritDoc} */ + @Override - protected void createControls(AbstractCdmDetailSection formElement, - int style) { - TableWrapLayout layout = (TableWrapLayout) getLayoutComposite().getLayout(); - layout.topMargin = 10; - layout.numColumns = 2; - - getLayoutComposite().setLayout(layout); - - - } - - /** - *setEntity
- * - * @param entity a {@link eu.etaxonomy.cdm.model.media.Media} object. - */ - public void setEntity(Media entity) { - if(element_media != null){ + public void setEntity(Media entity) { + if(mediaMetaElement != null){ this.removeElements(); } - element_media = (MediaElement) formFactory.createEntityCollectionElement(this, entity, null, null, Section.EXPANDED); - formFactory.addPropertyChangeListener(element_media); + mediaMetaElement = (MediaMetaElement) formFactory.createEntityCollectionElement(this, entity, null, null, ExpandableComposite.EXPANDED); super.setEntity(entity); setSectionTitle(); + setTextClient(createToolbar()); layout(); } - /* (non-Javadoc) - * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading() - */ /** {@inheritDoc} */ @Override public String getHeading() { return "Image"; } + + @Override + protected AbstractCdmDetailElement