private List<IResource> getResources() { ISelection s= fProvider.getSelection(); if (!(s instanceof IStructuredSelection)) return null; return convertIntoResources((IStructuredSelection)s); }
private List getResources() { ISelection s= fProvider.getSelection(); if (!(s instanceof IStructuredSelection)) return null; return convertIntoResources((IStructuredSelection)s); }
private List<IResource> getResources() { ISelection s= fProvider.getSelection(); if (!(s instanceof IStructuredSelection)) return null; return convertIntoResources((IStructuredSelection)s); }
private boolean isDragable(ISelection s) { if (!(s instanceof IStructuredSelection)) return false; IStructuredSelection selection= (IStructuredSelection)s; for (Iterator iter= selection.iterator(); iter.hasNext();) { Object element= iter.next(); if (element instanceof IJavaElement) { IJavaElement jElement= (IJavaElement)element; int type= jElement.getElementType(); // valid elements are: roots, units and types. Don't allow dragging // projects outside of eclipse if (type != IJavaElement.PACKAGE_FRAGMENT_ROOT && type != IJavaElement.COMPILATION_UNIT && type != IJavaElement.TYPE) return false; IPackageFragmentRoot root= (IPackageFragmentRoot)jElement.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT); if (root != null && root.isArchive()) return false; } } List resources= convertIntoResources(selection); return resources.size() == selection.size(); }
private boolean isDragable(ISelection s) { if (!(s instanceof IStructuredSelection)) return false; IStructuredSelection selection= (IStructuredSelection)s; for (Iterator<?> iter= selection.iterator(); iter.hasNext();) { Object element= iter.next(); if (element instanceof IJavaElement) { IJavaElement jElement= (IJavaElement)element; int type= jElement.getElementType(); // valid elements are: roots, units and types. Don't allow dragging // projects outside of eclipse if (type != IJavaElement.PACKAGE_FRAGMENT_ROOT && type != IJavaElement.COMPILATION_UNIT && type != IJavaElement.TYPE) return false; IPackageFragmentRoot root= (IPackageFragmentRoot)jElement.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT); if (root != null && (root.isArchive() || root.isExternal())) return false; } else if (element instanceof IProject) { return false; } } List<IResource> resources= convertIntoResources(selection); return resources.size() == selection.size(); }
private boolean isDragable(ISelection s) { if (!(s instanceof IStructuredSelection)) return false; IStructuredSelection selection= (IStructuredSelection)s; for (Iterator<?> iter= selection.iterator(); iter.hasNext();) { Object element= iter.next(); if (element instanceof IJavaElement) { IJavaElement jElement= (IJavaElement)element; int type= jElement.getElementType(); // valid elements are: roots, units and types. Don't allow dragging // projects outside of eclipse if (type != IJavaElement.PACKAGE_FRAGMENT_ROOT && type != IJavaElement.COMPILATION_UNIT && type != IJavaElement.TYPE) return false; IPackageFragmentRoot root= (IPackageFragmentRoot)jElement.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT); if (root != null && (root.isArchive() || root.isExternal())) return false; } else if (element instanceof IProject) { return false; } } List<IResource> resources= convertIntoResources(selection); return resources.size() == selection.size(); }