*/
private void supportOutlineDND() {
TreeViewer treeViewer = getTreeViewer();
final LayoutODOMEditorContext odomEditorContext =
(LayoutODOMEditorContext) getODOMEditorContext();
Transfer transfer [] = new Transfer[]{
new ODOMElementTransfer(odomEditorContext.getODOMFactory(),
"layoutElements")
};
final ODOMSelectionFilter filter =
new ODOMSelectionFilter(null,
new String[]{
LayoutSchemaType.LAYOUT.getName(),
LayoutSchemaType.CANVAS_LAYOUT.getName(),
LayoutSchemaType.MONTAGE_LAYOUT.getName()
});
final ArrayBasedActionDetails actionDetails =
new ArrayBasedActionDetails();
// Set up a listener that will update the action's enablement
// status, using the {@link ODOMActionCommand#enable} method return
// value, storing the selection in the actionDetails
ODOMElementSelectionListener dndListener =
new ODOMElementSelectionListener() {
public void selectionChanged(ODOMElementSelectionEvent event) {
actionDetails.setElements(event.getSelection().
toODOMElementArray());
}
};
odomEditorContext.getODOMSelectionManager().
addSelectionListener(dndListener, filter);
int operations = DND.DROP_COPY | DND.DROP_MOVE;
treeViewer.addDragSupport(operations, transfer,
new LayoutDragSourceListener(transfer[0], actionDetails));
treeViewer.addDropSupport(operations, transfer,
new LayoutDropTargetListener(actionDetails,
odomEditorContext.getODOMSelectionManager(),
odomEditorContext.getLayoutEditorContext()));
}