private int handleValidateCopy(Object target) throws JavaModelException{ if (fCopyProcessor == null) { final ICopyPolicy policy= ReorgPolicyFactory.createCopyPolicy(ReorgUtils.getResources(fElements), ReorgUtils.getJavaElements(fElements)); fCopyProcessor= policy.canEnable() ? new JavaCopyProcessor(policy) : null; } if (!canCopyElements()) return DND.DROP_NONE; if (fCopyProcessor == null) return DND.DROP_NONE; if (!fCopyProcessor.setDestination(ReorgDestinationFactory.createDestination(target, getCurrentLocation())).isOK()) return DND.DROP_NONE; return DND.DROP_COPY; }
private int handleValidateCopy(Object target) throws JavaModelException{ if (fCopyProcessor == null) { final ICopyPolicy policy= ReorgPolicyFactory.createCopyPolicy(ReorgUtils.getResources(fElements), ReorgUtils.getJavaElements(fElements)); fCopyProcessor= policy.canEnable() ? new JavaCopyProcessor(policy) : null; } if (!canCopyElements()) return DND.DROP_NONE; if (fCopyProcessor == null) return DND.DROP_NONE; if (!fCopyProcessor.setDestination(ReorgDestinationFactory.createDestination(target, getCurrentLocation())).isOK()) return DND.DROP_NONE; return DND.DROP_COPY; }
private int handleValidateCopy(Object target, DropTargetEvent event) throws JavaModelException{ if (fCopyProcessor == null) { final ICopyPolicy policy= ReorgPolicyFactory.createCopyPolicy(ReorgUtils.getResources(fElements), ReorgUtils.getJavaElements(fElements)); fCopyProcessor= policy.canEnable() ? new JavaCopyProcessor(policy) : null; } if (!canCopyElements()) return DND.DROP_NONE; if (target instanceof IResource && fCopyProcessor != null && fCopyProcessor.setDestination((IResource)target).isOK()) return DND.DROP_COPY; else if (target instanceof IJavaElement && fCopyProcessor != null && fCopyProcessor.setDestination((IJavaElement)target).isOK()) return DND.DROP_COPY; else return DND.DROP_NONE; }