private int internalDetermineOperation(Object target, int operation, int operations) { initializeSelection(); if (target == null) return DND.DROP_NONE; //Do not allow to drop on itself, bug 14228 if (getCurrentLocation() == LOCATION_ON) { IJavaElement[] javaElements= ReorgUtils.getJavaElements(fElements); if (contains(javaElements, target)) return DND.DROP_NONE; IResource[] resources= ReorgUtils.getResources(fElements); if (contains(resources, target)) return DND.DROP_NONE; } try { switch(operation) { case DND.DROP_DEFAULT: return handleValidateDefault(target, operations); case DND.DROP_COPY: return handleValidateCopy(target); case DND.DROP_MOVE: return handleValidateMove(target); } } catch (JavaModelException e){ ExceptionHandler.handle(e, PackagesMessages.SelectionTransferDropAdapter_error_title, PackagesMessages.SelectionTransferDropAdapter_error_message); } return DND.DROP_NONE; }
private int internalDetermineOperation(Object target, int operation, int operations) { initializeSelection(); if (target == null) return DND.DROP_NONE; //Do not allow to drop on itself, bug 14228 if (getCurrentLocation() == LOCATION_ON) { IJavaElement[] javaElements= ReorgUtils.getJavaElements(fElements); if (contains(javaElements, target)) return DND.DROP_NONE; IResource[] resources= ReorgUtils.getResources(fElements); if (contains(resources, target)) return DND.DROP_NONE; } try { switch(operation) { case DND.DROP_DEFAULT: return handleValidateDefault(target, operations); case DND.DROP_COPY: return handleValidateCopy(target); case DND.DROP_MOVE: return handleValidateMove(target); } } catch (JavaModelException e){ ExceptionHandler.handle(e, PackagesMessages.SelectionTransferDropAdapter_error_title, PackagesMessages.SelectionTransferDropAdapter_error_message); } return DND.DROP_NONE; }