IEditorReference[] editorRefs = GuiHelper.getActivePage().getEditorReferences();
int idx = 0;
// get the editor instance by given id (pEditorId)
for (int i = 0; i < editorRefs.length; i++)
{
IEditorReference editRef = editorRefs[i];
if (editRef.getId().equals(pEditorId) && editRef.getEditor(false).equals(result))
{
idx = i;
break;
}
}
// create drag-and drop-source of editor
EditorDragSource editorDragSource = new EditorDragSource(idx, false);
EditorAreaDropTarget dropLocation = new EditorAreaDropTarget(editorDragSource, SWT.BOTTOM);
// force dnd of editor
editorDragSource.drag(dropLocation);
]]>