@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()]); }
@Override public ResourceTraversal[] getTraversals( ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { IJavaProject[] projects = fJavaModel.getJavaProjects(); ResourceTraversal[] result = new ResourceTraversal[projects.length]; for (int i = 0; i < projects.length; i++) { result[i] = new ResourceTraversal( new IResource[] {projects[i].getProject()}, IResource.DEPTH_INFINITE, 0); } return result; }
@Override public ResourceTraversal[] getTraversals( ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { return new ResourceTraversal[] { new ResourceTraversal(new IResource[] {fProject.getProject()}, IResource.DEPTH_INFINITE, 0) }; }
@Override public ResourceTraversal[] getTraversals( ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { return new ResourceTraversal[] { new ResourceTraversal(new IResource[] {fRoot.getResource()}, IResource.DEPTH_INFINITE, 0) }; }
@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 { return new ResourceTraversal[] { new ResourceTraversal(new IResource[] {fUnit.getResource()}, IResource.DEPTH_ONE, 0) }; }
@Override public ResourceTraversal[] getTraversals( ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { return new ResourceTraversal[] { new ResourceTraversal(new IResource[] {fClassFile.getResource()}, IResource.DEPTH_ONE, 0) }; }
/** {@inheritDoc} */ public final ResourceTraversal[] getTraversals( final ResourceMappingContext context, final IProgressMonitor monitor) throws CoreException { if (fResourceTraversals == null) { fResourceTraversals = new ResourceTraversal[] {}; final long stamp = fDescriptor.getTimeStamp(); if (stamp >= 0) { final IPath path = RefactoringHistoryManager.stampToPath(stamp); if (path != null) { final IProject[] projects = getProjects(); if (projects != null && projects.length == 1 && projects[0] != null) { final IFolder folder = projects[0] .getFolder(RefactoringHistoryService.NAME_HISTORY_FOLDER) .getFolder(path); fResourceTraversals = new ResourceTraversal[] { new ResourceTraversal( new IResource[] {folder.getFile(RefactoringHistoryService.NAME_HISTORY_FILE)}, IResource.DEPTH_ZERO, IResource.NONE), new ResourceTraversal( new IResource[] {folder.getFile(RefactoringHistoryService.NAME_INDEX_FILE)}, IResource.DEPTH_ZERO, IResource.NONE) }; } } } } final ResourceTraversal[] traversals = new ResourceTraversal[fResourceTraversals.length]; System.arraycopy(fResourceTraversals, 0, traversals, 0, fResourceTraversals.length); return traversals; }
@Override public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { IJavaProject[] projects= fJavaModel.getJavaProjects(); ResourceTraversal[] result= new ResourceTraversal[projects.length]; for (int i= 0; i < projects.length; i++) { result[i]= new ResourceTraversal(new IResource[] {projects[i].getProject()}, IResource.DEPTH_INFINITE, 0); } return result; }
@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()]); }
/** * {@inheritDoc} */ @Override public ResourceMapping[] getMappings(final IResource resource, final ResourceMappingContext context, final IProgressMonitor monitor) throws CoreException { final IJavaElement element= JavaCore.create(resource); if (element != null) return new ResourceMapping[] { JavaElementResourceMapping.create(element)}; final Object adapted= resource.getAdapter(ResourceMapping.class); if (adapted instanceof ResourceMapping) return new ResourceMapping[] { ((ResourceMapping) adapted)}; return new ResourceMapping[] { new JavaResourceMapping(resource)}; }
/** * Returns the resource traversals for the element. * * @param element * the element to get the resource traversals * @return the resource traversals */ static ResourceTraversal[] getResourceTraversals(final Object element) { final ResourceMapping mapping= getResourceMapping(element); if (mapping != null) try { return mapping.getTraversals(ResourceMappingContext.LOCAL_CONTEXT, new NullProgressMonitor()); } catch (final CoreException exception) { JavaPlugin.log(exception); } return new ResourceTraversal[0]; }
@Override public ResourceTraversal[] getTraversals(final ResourceMappingContext context, final IProgressMonitor monitor) throws CoreException { return new ResourceTraversal[] { new ResourceTraversal(getProjects(), DEPTH_INFINITE, 0) }; }
@Override public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { return new ResourceTraversal[] { new ResourceTraversal(new IResource[] {fProject.getProject()}, IResource.DEPTH_INFINITE, 0) }; }
@Override public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { return new ResourceTraversal[] { new ResourceTraversal(new IResource[] {fRoot.getResource()}, IResource.DEPTH_INFINITE, 0) }; }
@Override public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { return new ResourceTraversal[] { new ResourceTraversal(new IResource[] {fUnit.getResource()}, IResource.DEPTH_ONE, 0) }; }
@Override public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { return new ResourceTraversal[] { new ResourceTraversal(new IResource[] {fClassFile.getResource()}, IResource.DEPTH_ONE, 0) }; }
@Override public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { return new ResourceTraversal[] { new ResourceTraversal(new IResource[] {fPack.getResource()}, IResource.DEPTH_INFINITE, 0) }; }
/** * {@inheritDoc} */ @Override public ResourceTraversal[] getTraversals(final ResourceMappingContext context, final IProgressMonitor monitor) { return new ResourceTraversal[] { new ResourceTraversal(new IResource[] { fResource }, IResource.DEPTH_INFINITE, IResource.NONE) }; }