private static ResourceTraversal[] getRemotePackageFragmentTraversals( IPackageFragment pack, RemoteResourceMappingContext context, IProgressMonitor monitor) throws CoreException { ArrayList<ResourceTraversal> res = new ArrayList<ResourceTraversal>(); IContainer container = (IContainer) pack.getResource(); if (container != null) { res.add(new ResourceTraversal(new IResource[] {container}, IResource.DEPTH_ONE, 0)); IResource[] remoteMembers = context.fetchRemoteMembers(container, monitor); if (remoteMembers == null) { remoteMembers = context.fetchMembers(container, monitor); } if (remoteMembers != null) { for (int i = 0; i < remoteMembers.length; i++) { IResource member = remoteMembers[i]; if (member instanceof IFolder && JavaConventionsUtil.validatePackageName(member.getName(), pack).getSeverity() == IStatus.ERROR) { res.add(new ResourceTraversal(new IResource[] {member}, IResource.DEPTH_INFINITE, 0)); } } } } return res.toArray(new ResourceTraversal[res.size()]); }
@Override public ResourceTraversal[] getTraversals( ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { List<ResourceTraversal> result = new ArrayList<ResourceTraversal>(); if (context instanceof RemoteResourceMappingContext) { for (int i = 0; i < fFragments.length; i++) { result.addAll( Arrays.asList( getRemotePackageFragmentTraversals( fFragments[i], (RemoteResourceMappingContext) context, monitor))); } } else { for (int i = 0; i < fFragments.length; i++) { result.addAll(Arrays.asList(getPackageFragmentTraversals(fFragments[i]))); } } return result.toArray(new ResourceTraversal[result.size()]); }
private static ResourceTraversal[] getRemotePackageFragmentTraversals(IPackageFragment pack, RemoteResourceMappingContext context, IProgressMonitor monitor) throws CoreException { ArrayList<ResourceTraversal> res= new ArrayList<ResourceTraversal>(); IContainer container= (IContainer)pack.getResource(); if (container != null) { res.add(new ResourceTraversal(new IResource[] {container}, IResource.DEPTH_ONE, 0)); IResource[] remoteMembers= context.fetchRemoteMembers(container, monitor); if (remoteMembers == null) { remoteMembers= context.fetchMembers(container, monitor); } if (remoteMembers != null) { for (int i= 0; i < remoteMembers.length; i++) { IResource member= remoteMembers[i]; if (member instanceof IFolder && JavaConventionsUtil.validatePackageName(member.getName(), pack).getSeverity() == IStatus.ERROR) { res.add(new ResourceTraversal(new IResource[] { member }, IResource.DEPTH_INFINITE, 0)); } } } } return res.toArray(new ResourceTraversal[res.size()]); }
@Override public ResourceTraversal[] getTraversals( ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { if (context instanceof RemoteResourceMappingContext) { return getRemotePackageFragmentTraversals( fPack, (RemoteResourceMappingContext) context, monitor); } else { return getPackageFragmentTraversals(fPack); } }
@Override public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { if (context instanceof RemoteResourceMappingContext) { return getRemotePackageFragmentTraversals(fPack, (RemoteResourceMappingContext)context, monitor); } else { return getPackageFragmentTraversals(fPack); } }
@Override public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { List<ResourceTraversal> result= new ArrayList<ResourceTraversal>(); if (context instanceof RemoteResourceMappingContext) { for (int i= 0; i < fFragments.length; i++) { result.addAll(Arrays.asList(getRemotePackageFragmentTraversals(fFragments[i], (RemoteResourceMappingContext)context, monitor))); } } else { for (int i= 0; i < fFragments.length; i++) { result.addAll(Arrays.asList(getPackageFragmentTraversals(fFragments[i]))); } } return result.toArray(new ResourceTraversal[result.size()]); }