-// $Id$
/**
* Copyright (C) 2007 EDIT
* European Distributed Institute of Taxonomy
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.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;
/**
* <p>MediaDetailsSection class.</p>
*/
public class MediaDetailsSection extends AbstractCdmDetailSection<Media> {
- private MediaElement element_media;
+ private MediaMetaElement mediaMetaElement;
- /**
- * <p>Constructor for MediaDetailsSection.</p>
- *
- * @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);
}
- /** {@inheritDoc} */
- @Override
- protected void createControls(AbstractCdmDetailSection formElement,
- int style) {
- TableWrapLayout layout = (TableWrapLayout) getLayoutComposite().getLayout();
- layout.topMargin = 10;
- layout.numColumns = 2;
-
- getLayoutComposite().setLayout(layout);
-
-
- }
-
- /**
- * <p>setEntity</p>
- *
- * @param entity a {@link eu.etaxonomy.cdm.model.media.Media} object.
- */
@Override
public void setEntity(Media entity) {
- if(element_media != null){
+ 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";
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
- */
@Override
protected AbstractCdmDetailElement<Media> createCdmDetailElement(AbstractCdmDetailSection<Media> parentElement, int style) {
return null;