org.eclipse.core.resources.mapping.ResourceMappingContext Java Examples
The following examples show how to use
org.eclipse.core.resources.mapping.ResourceMappingContext.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JavaElementResourceMapping.java From eclipse.jdt.ls with Eclipse Public License 2.0 | 5 votes |
@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; }
Example #2
Source File: JavaSynchronizationContentProvider.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
/** * 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]; }
Example #3
Source File: JavaModelProvider.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
/** * {@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)}; }
Example #4
Source File: JavaElementResourceMapping.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
@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()]); }
Example #5
Source File: JavaElementResourceMapping.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
@Override public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { if (context instanceof RemoteResourceMappingContext) { return getRemotePackageFragmentTraversals(fPack, (RemoteResourceMappingContext)context, monitor); } else { return getPackageFragmentTraversals(fPack); } }
Example #6
Source File: JavaElementResourceMapping.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
@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; }
Example #7
Source File: JavaElementResourceMapping.java From eclipse.jdt.ls with Eclipse Public License 2.0 | 5 votes |
@Override public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { List<ResourceTraversal> result= new ArrayList<>(); 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()]); }
Example #8
Source File: JavaElementResourceMapping.java From eclipse.jdt.ls with Eclipse Public License 2.0 | 5 votes |
@Override public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { if (context instanceof RemoteResourceMappingContext) { return getRemotePackageFragmentTraversals(fPack, (RemoteResourceMappingContext)context, monitor); } else { return getPackageFragmentTraversals(fPack); } }
Example #9
Source File: JavaElementResourceMapping.java From eclipse.jdt.ls with Eclipse Public License 2.0 | 4 votes |
@Override public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { return new ResourceTraversal[] { new ResourceTraversal(new IResource[] {fClassFile.getResource()}, IResource.DEPTH_ONE, 0) }; }
Example #10
Source File: SimpleResourceMapping.java From xds-ide with Eclipse Public License 1.0 | 4 votes |
@Override public ResourceTraversal[] getTraversals( ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { return new ResourceTraversal[]{new ResourceTraversal(new IResource[]{r}, IResource.DEPTH_ONE, IResource.NONE)}; }
Example #11
Source File: JavaElementResourceMapping.java From eclipse.jdt.ls with Eclipse Public License 2.0 | 4 votes |
@Override public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { return new ResourceTraversal[] { new ResourceTraversal(new IResource[] {fUnit.getResource()}, IResource.DEPTH_ONE, 0) }; }
Example #12
Source File: JavaElementResourceMapping.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
@Override public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { return new ResourceTraversal[] { new ResourceTraversal(new IResource[] {fProject.getProject()}, IResource.DEPTH_INFINITE, 0) }; }
Example #13
Source File: JavaElementResourceMapping.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
@Override public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { return new ResourceTraversal[] { new ResourceTraversal(new IResource[] {fRoot.getResource()}, IResource.DEPTH_INFINITE, 0) }; }
Example #14
Source File: JavaElementResourceMapping.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
@Override public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { return new ResourceTraversal[] { new ResourceTraversal(new IResource[] {fUnit.getResource()}, IResource.DEPTH_ONE, 0) }; }
Example #15
Source File: JavaElementResourceMapping.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
@Override public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { return new ResourceTraversal[] { new ResourceTraversal(new IResource[] {fClassFile.getResource()}, IResource.DEPTH_ONE, 0) }; }
Example #16
Source File: JavaElementResourceMapping.java From eclipse.jdt.ls with Eclipse Public License 2.0 | 4 votes |
@Override public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { return new ResourceTraversal[] { new ResourceTraversal(new IResource[] {fRoot.getResource()}, IResource.DEPTH_INFINITE, 0) }; }
Example #17
Source File: HierarchicalDecorationContext.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
@Override public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { return new ResourceTraversal[] { new ResourceTraversal(new IResource[] {fPack.getResource()}, IResource.DEPTH_INFINITE, 0) }; }
Example #18
Source File: JavaResourceMapping.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
/** * {@inheritDoc} */ @Override public ResourceTraversal[] getTraversals(final ResourceMappingContext context, final IProgressMonitor monitor) { return new ResourceTraversal[] { new ResourceTraversal(new IResource[] { fResource }, IResource.DEPTH_INFINITE, IResource.NONE) }; }
Example #19
Source File: JavaElementResourceMapping.java From eclipse.jdt.ls with Eclipse Public License 2.0 | 4 votes |
@Override public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { return new ResourceTraversal[] { new ResourceTraversal(new IResource[] {fProject.getProject()}, IResource.DEPTH_INFINITE, 0) }; }
Example #20
Source File: WorkingSetAdapter.java From n4js with Eclipse Public License 1.0 | 4 votes |
@Override public ResourceTraversal[] getTraversals(final ResourceMappingContext context, final IProgressMonitor monitor) throws CoreException { return new ResourceTraversal[] { new ResourceTraversal(getProjects(), DEPTH_INFINITE, 0) }; }