1 11 package org.eclipse.jdt.internal.ui.model; 12 13 import org.eclipse.core.runtime.Assert; 14 import org.eclipse.core.runtime.IProgressMonitor; 15 16 import org.eclipse.core.resources.IProject; 17 import org.eclipse.core.resources.IResource; 18 import org.eclipse.core.resources.mapping.ResourceMapping; 19 import org.eclipse.core.resources.mapping.ResourceMappingContext; 20 import org.eclipse.core.resources.mapping.ResourceTraversal; 21 22 27 public final class JavaResourceMapping extends ResourceMapping { 28 29 30 private final IResource fResource; 31 32 38 public JavaResourceMapping(final IResource resource) { 39 Assert.isNotNull(resource); 40 fResource= resource; 41 } 42 43 46 public Object getModelObject() { 47 return fResource; 48 } 49 50 53 public String getModelProviderId() { 54 return JavaModelProvider.JAVA_MODEL_PROVIDER_ID; 55 } 56 57 60 public IProject[] getProjects() { 61 return new IProject[] { fResource.getProject() }; 62 } 63 64 67 public ResourceTraversal[] getTraversals(final ResourceMappingContext context, final IProgressMonitor monitor) { 68 return new ResourceTraversal[] { new ResourceTraversal(new IResource[] { fResource }, IResource.DEPTH_INFINITE, IResource.NONE) }; 69 } 70 } 71 | Popular Tags |