Revision b7e704af
Added by Katja Luther almost 4 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/dnd/NameEditorDragListenerE4.java | ||
---|---|---|
11 | 11 |
import eu.etaxonomy.cdm.model.common.ICdmBase; |
12 | 12 |
import eu.etaxonomy.taxeditor.editor.CdmDataTransfer; |
13 | 13 |
import eu.etaxonomy.taxeditor.editor.name.e4.container.AbstractGroupedContainerE4; |
14 |
import eu.etaxonomy.taxeditor.editor.name.e4.container.ConceptContainerE4; |
|
14 | 15 |
|
15 | 16 |
/** |
16 | 17 |
* |
... | ... | |
45 | 46 |
public void dragSetData(DragSourceEvent event) { |
46 | 47 |
ICdmBase[] cdmBaseObjects = new ICdmBase[]{container.getData()}; |
47 | 48 |
if(CdmDataTransfer.getInstance().isSupportedType(event.dataType)){ |
48 |
event.data = cdmBaseObjects;
|
|
49 |
}
|
|
49 |
event.data = cdmBaseObjects;
|
|
50 |
}
|
|
50 | 51 |
} |
51 | 52 |
|
52 | 53 |
/** {@inheritDoc} */ |
53 | 54 |
@Override |
54 | 55 |
public void dragStart(DragSourceEvent event) { |
55 |
event.doit = container.getData() != null;
|
|
56 |
event.doit = (container.getData() != null) && !(container instanceof ConceptContainerE4);
|
|
56 | 57 |
} |
57 | 58 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/dnd/NameEditorDropTargetListenerE4.java | ||
---|---|---|
56 | 56 |
target.dragLeft(); |
57 | 57 |
} |
58 | 58 |
|
59 |
|
|
59 | 60 |
/** {@inheritDoc} */ |
60 | 61 |
@Override |
61 | 62 |
public void drop(DropTargetEvent dropTargetEvent) { |
... | ... | |
70 | 71 |
return; |
71 | 72 |
} |
72 | 73 |
|
74 |
if (target instanceof MisappliedGroupE4){ |
|
75 |
dropTargetEvent.detail = DND.DROP_NONE; |
|
76 |
return; |
|
77 |
} |
|
78 |
|
|
73 | 79 |
// Execute operations at end of drag event |
74 | 80 |
AbstractPostOperation operation = createOperation(taxonBase); |
75 | 81 |
|
Also available in: Unified diff
fix #7544: do not allow d&d for misapplied names