import org.eclipse.swt.dnd.DragSourceAdapter;
import org.eclipse.swt.dnd.DragSourceEvent;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.description.DescriptionBase;
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
public class DescriptionElementDragListener extends DragSourceAdapter {
private DescriptiveViewPart part;
+ private DescriptionBase description;
public DescriptionElementDragListener(DescriptiveViewPart part){
this.part = part;
return;
// FIXME what to do here?
if (event.detail != DND.DROP_NONE) {
- IStructuredSelection selection = (IStructuredSelection) part.getViewer()
- .getSelection();
- part.changed(null);
+ //IStructuredSelection selection = (IStructuredSelection) part.getViewer().getSelection();
+ part.getViewer().refresh();
+
+ part.changed(null);
}
}
for (Object object : selection.toList()){
if(object instanceof DescriptionBase){
descriptionElements.addAll(((DescriptionBase) object).getElements());
+ description = HibernateProxyHelper.deproxy(object, DescriptionBase.class);
+
}else if(object instanceof FeatureNodeContainer){
descriptionElements.addAll(((FeatureNodeContainer) object).getDescriptionElements());
}else if(object instanceof DescriptionElementBase){
if (DescriptionElementTransfer.getInstance().isSupportedType(
event.dataType)) {
event.data = descriptionElements.toArray(new DescriptionElementBase[descriptionElements.size()]);
+
}
+
}
/**