+
+ // Check if the drag action should start.
+ public void dragStart(DragSourceEvent event) {
+ // we only start drag if at least one of the selected elements is
+ // valid
+ boolean doIt = false;
+ IStructuredSelection selection = (IStructuredSelection) viewer
+ .getSelection();
+ @SuppressWarnings("rawtypes")
+ Iterator it = selection.iterator();
+ try {
+ while (it.hasNext()) {
+ Object obj = it.next();
+ if (obj instanceof Node) {
+ Node node = (Node) obj;
+ if (node.isNodeType(SlcTypes.SLC_EXECUTION_FLOW)
+ || node.isNodeType(SlcTypes.SLC_EXECUTION_MODULE)) {
+ doIt = true;
+ }
+ }
+ }
+ } catch (RepositoryException e) {
+ throw new SlcException("Cannot read node to set drag data", e);
+ }
+ event.doit = doIt;
+ }
+