- if(context.draggable != null){
- DnDFocusPanel toDrop = (DnDFocusPanel) context.draggable;
- //prevent drag and drop for trashed files and for unselected tree items
- if(toDrop.getFiles() != null && folders.isTrashItem(folders.getCurrent()))
- throw new VetoDragException();
- else if(toDrop.getItem() != null && !toDrop.getItem().equals(folders.getCurrent()))
- throw new VetoDragException();
- else if(toDrop.getItem() != null && !toDrop.getItem().isDraggable())
- throw new VetoDragException();
-
- }
+ if(context.draggable != null)
+ if(context.draggable instanceof DnDFocusPanel){
+ DnDFocusPanel toDrop = (DnDFocusPanel) context.draggable;
+ //prevent drag and drop for trashed files and for unselected tree items
+ if(toDrop.getFiles() != null && folders.isTrashItem(folders.getCurrent()))
+ throw new VetoDragException();
+ else if(toDrop.getItem() != null && !toDrop.getItem().equals(folders.getCurrent()))
+ throw new VetoDragException();
+ else if(toDrop.getItem() != null && !toDrop.getItem().isDraggable())
+ throw new VetoDragException();
+
+ }
+ else if(context.draggable instanceof DnDSimpleFocusPanel){
+ DnDSimpleFocusPanel toDrop = (DnDSimpleFocusPanel) context.draggable;
+ //prevent drag and drop for trashed files and for unselected tree items
+ if(toDrop.getFiles() != null && folders.isTrashItem(folders.getCurrent()))
+ throw new VetoDragException();
+ }