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 org
.eclipse
.jface
.action
.Action
;
14 import org
.eclipse
.jface
.action
.IAction
;
15 import org
.eclipse
.jface
.action
.ToolBarManager
;
16 import org
.eclipse
.jface
.viewers
.ISelectionProvider
;
17 import org
.eclipse
.swt
.SWT
;
18 import org
.eclipse
.swt
.widgets
.Control
;
20 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
21 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
22 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
23 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailSection
;
31 public abstract class AbstractTogglableMediaDetailsSection
<ENTITY
> extends AbstractCdmDetailSection
<ENTITY
> {
33 private ITogglableMediaElement togglableMediaElement
;
35 public AbstractTogglableMediaDetailsSection(CdmFormFactory formFactory
, ConversationHolder conversation
,
36 ICdmFormElement parentElement
,
37 ISelectionProvider selectionProvider
, int style
) {
38 super(formFactory
, conversation
, parentElement
, selectionProvider
, style
);
42 protected Control
createToolbar() {
43 ToolBarManager toolBarManager
= new ToolBarManager(SWT
.FLAT
);
45 final String label
= "Change View Type";
47 Action addAction
= new Action(label
, IAction
.AS_PUSH_BUTTON
) {
50 if(togglableMediaElement
!=null){
51 togglableMediaElement
.toggleAdvancedMediaView();
55 addAction
.setToolTipText(label
);
57 toolBarManager
.add(addAction
);
59 return toolBarManager
.createControl(this);
62 public void setTogglableMediaElement(ITogglableMediaElement togglableMediaElement
) {
63 this.togglableMediaElement
= togglableMediaElement
;
66 public ITogglableMediaElement
getTogglableMediaElement() {
67 return togglableMediaElement
;