3 * Copyright (C) 2013 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.
10 package eu
.etaxonomy
.taxeditor
.ui
.campanula
.basicFields
;
12 import org
.eclipse
.jface
.action
.Action
;
13 import org
.eclipse
.jface
.action
.IAction
;
14 import org
.eclipse
.jface
.action
.ToolBarManager
;
15 import org
.eclipse
.swt
.SWT
;
16 import org
.eclipse
.swt
.widgets
.Composite
;
17 import org
.eclipse
.swt
.widgets
.Display
;
18 import org
.eclipse
.swt
.widgets
.Label
;
19 import org
.eclipse
.swt
.widgets
.ToolBar
;
20 import org
.eclipse
.ui
.forms
.widgets
.ExpandableComposite
;
21 import org
.eclipse
.ui
.forms
.widgets
.FormToolkit
;
22 import org
.eclipse
.wb
.swt
.ResourceManager
;
23 import org
.eclipse
.wb
.swt
.SWTResourceManager
;
30 public class EntityCollectionElement
extends ExpandableComposite
{
31 private final FormToolkit formToolkit
= new FormToolkit(Display
.getDefault());
34 * Create the composite.
38 public EntityCollectionElement(Composite parent
, int style
) {
40 setBackground(SWTResourceManager
.getColor(SWT
.COLOR_WHITE
));
43 ToolBar toolBar
= new ToolBar(this, SWT
.FLAT
| SWT
.RIGHT
);
44 setTextClient(toolBar
);
46 Label label
= formToolkit
.createLabel(this, "", SWT
.NONE
);
49 ToolBarManager toolBarManager
= new ToolBarManager(SWT
.FLAT
);
51 Action addAction
= new Action("add", IAction
.AS_PUSH_BUTTON
){
53 * @see org.eclipse.jface.action.Action#run()
57 // ELEMENT element = createNewElement();
58 // if(element != null){
59 // addElement(element);
60 // if(! getSection().isExpanded()) {
61 // getSection().setExpanded(true);
63 // internalUpdateSection(true);
67 addAction
.setImageDescriptor(ResourceManager
.getPluginImageDescriptor("eu.etaxonomy.taxeditor.store", "icons/add_no_bg2.gif"));
68 // addAction.setToolTipText(getTooltipString());
70 toolBarManager
.add(addAction
);
75 protected void checkSubclass() {
76 // Disable the check that prevents subclassing of SWT components