4 package eu
.etaxonomy
.taxeditor
.editor
.name
.e4
.dnd
;
6 import org
.eclipse
.swt
.dnd
.DND
;
7 import org
.eclipse
.swt
.dnd
.DragSourceAdapter
;
8 import org
.eclipse
.swt
.dnd
.DragSourceEvent
;
9 import org
.eclipse
.ui
.forms
.ManagedForm
;
11 import eu
.etaxonomy
.cdm
.model
.common
.ICdmBase
;
12 import eu
.etaxonomy
.taxeditor
.editor
.CdmDataTransfer
;
13 import eu
.etaxonomy
.taxeditor
.editor
.name
.e4
.container
.AbstractGroupedContainerE4
;
21 public class NameEditorDragListenerE4
extends DragSourceAdapter
{
23 private AbstractGroupedContainerE4 container
;
25 public NameEditorDragListenerE4(AbstractGroupedContainerE4 container
){
26 this.container
= container
;
31 public void dragFinished(DragSourceEvent event
) {
35 if(event
.detail
== DND
.DROP_MOVE
){
36 ManagedForm managedForm
= container
.getGroup().getEditor().getManagedForm();
37 container
.getGroup().remove(container
);
38 managedForm
.reflow(true);
45 public void dragSetData(DragSourceEvent event
) {
46 ICdmBase
[] cdmBaseObjects
= new ICdmBase
[]{container
.getData()};
47 if(CdmDataTransfer
.getInstance().isSupportedType(event
.dataType
)){
48 event
.data
= cdmBaseObjects
;
54 public void dragStart(DragSourceEvent event
) {
55 event
.doit
= container
.getData() != null;