Java 类org.eclipse.core.resources.mapping.ResourceMappingContext 实例源码

项目:che    文件:JavaElementResourceMapping.java   
@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()]);
}
项目:che    文件:JavaElementResourceMapping.java   
@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;
}
项目:che    文件:JavaElementResourceMapping.java   
@Override
public ResourceTraversal[] getTraversals(
    ResourceMappingContext context, IProgressMonitor monitor) throws CoreException {
  return new ResourceTraversal[] {
    new ResourceTraversal(new IResource[] {fProject.getProject()}, IResource.DEPTH_INFINITE, 0)
  };
}
项目:che    文件:JavaElementResourceMapping.java   
@Override
public ResourceTraversal[] getTraversals(
    ResourceMappingContext context, IProgressMonitor monitor) throws CoreException {
  return new ResourceTraversal[] {
    new ResourceTraversal(new IResource[] {fRoot.getResource()}, IResource.DEPTH_INFINITE, 0)
  };
}
项目:che    文件:JavaElementResourceMapping.java   
@Override
public ResourceTraversal[] getTraversals(
    ResourceMappingContext context, IProgressMonitor monitor) throws CoreException {
  if (context instanceof RemoteResourceMappingContext) {
    return getRemotePackageFragmentTraversals(
        fPack, (RemoteResourceMappingContext) context, monitor);
  } else {
    return getPackageFragmentTraversals(fPack);
  }
}
项目:che    文件:JavaElementResourceMapping.java   
@Override
public ResourceTraversal[] getTraversals(
    ResourceMappingContext context, IProgressMonitor monitor) throws CoreException {
  return new ResourceTraversal[] {
    new ResourceTraversal(new IResource[] {fUnit.getResource()}, IResource.DEPTH_ONE, 0)
  };
}
项目:che    文件:JavaElementResourceMapping.java   
@Override
public ResourceTraversal[] getTraversals(
    ResourceMappingContext context, IProgressMonitor monitor) throws CoreException {
  return new ResourceTraversal[] {
    new ResourceTraversal(new IResource[] {fClassFile.getResource()}, IResource.DEPTH_ONE, 0)
  };
}
项目:che    文件:AbstractRefactoringDescriptorResourceMapping.java   
/** {@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;
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaElementResourceMapping.java   
@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;
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaElementResourceMapping.java   
@Override
public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException {
    if (context instanceof RemoteResourceMappingContext) {
        return getRemotePackageFragmentTraversals(fPack, (RemoteResourceMappingContext)context, monitor);
    } else {
        return getPackageFragmentTraversals(fPack);
    }
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaElementResourceMapping.java   
@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()]);
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaModelProvider.java   
/**
 * {@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)};
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaSynchronizationContentProvider.java   
/**
 * 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];
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaElementResourceMapping.java   
@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;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaElementResourceMapping.java   
@Override
public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException {
    if (context instanceof RemoteResourceMappingContext) {
        return getRemotePackageFragmentTraversals(fPack, (RemoteResourceMappingContext)context, monitor);
    } else {
        return getPackageFragmentTraversals(fPack);
    }
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaElementResourceMapping.java   
@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()]);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaModelProvider.java   
/**
 * {@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)};
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaSynchronizationContentProvider.java   
/**
 * 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];
}
项目:n4js    文件:WorkingSetAdapter.java   
@Override
public ResourceTraversal[] getTraversals(final ResourceMappingContext context, final IProgressMonitor monitor)
        throws CoreException {

    return new ResourceTraversal[] { new ResourceTraversal(getProjects(), DEPTH_INFINITE, 0) };
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaElementResourceMapping.java   
@Override
public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException {
    return new ResourceTraversal[] {
        new ResourceTraversal(new IResource[] {fProject.getProject()}, IResource.DEPTH_INFINITE, 0)
    };
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaElementResourceMapping.java   
@Override
public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException {
    return new ResourceTraversal[] {
        new ResourceTraversal(new IResource[] {fRoot.getResource()}, IResource.DEPTH_INFINITE, 0)
    };
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaElementResourceMapping.java   
@Override
public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException {
    return new ResourceTraversal[] {
        new ResourceTraversal(new IResource[] {fUnit.getResource()}, IResource.DEPTH_ONE, 0)
    };
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaElementResourceMapping.java   
@Override
public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException {
    return new ResourceTraversal[] {
        new ResourceTraversal(new IResource[] {fClassFile.getResource()}, IResource.DEPTH_ONE, 0)
    };
}
项目:Eclipse-Postfix-Code-Completion    文件:HierarchicalDecorationContext.java   
@Override
public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException {
    return new ResourceTraversal[] {
        new ResourceTraversal(new IResource[] {fPack.getResource()}, IResource.DEPTH_INFINITE, 0)
    };
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaResourceMapping.java   
/**
 * {@inheritDoc}
 */
@Override
public ResourceTraversal[] getTraversals(final ResourceMappingContext context, final IProgressMonitor monitor) {
    return new ResourceTraversal[] { new ResourceTraversal(new IResource[] { fResource }, IResource.DEPTH_INFINITE, IResource.NONE) };
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaElementResourceMapping.java   
@Override
public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException {
    return new ResourceTraversal[] {
        new ResourceTraversal(new IResource[] {fProject.getProject()}, IResource.DEPTH_INFINITE, 0)
    };
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaElementResourceMapping.java   
@Override
public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException {
    return new ResourceTraversal[] {
        new ResourceTraversal(new IResource[] {fRoot.getResource()}, IResource.DEPTH_INFINITE, 0)
    };
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaElementResourceMapping.java   
@Override
public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException {
    return new ResourceTraversal[] {
        new ResourceTraversal(new IResource[] {fUnit.getResource()}, IResource.DEPTH_ONE, 0)
    };
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaElementResourceMapping.java   
@Override
public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException {
    return new ResourceTraversal[] {
        new ResourceTraversal(new IResource[] {fClassFile.getResource()}, IResource.DEPTH_ONE, 0)
    };
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:HierarchicalDecorationContext.java   
@Override
public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException {
    return new ResourceTraversal[] {
        new ResourceTraversal(new IResource[] {fPack.getResource()}, IResource.DEPTH_INFINITE, 0)
    };
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaResourceMapping.java   
/**
 * {@inheritDoc}
 */
@Override
public ResourceTraversal[] getTraversals(final ResourceMappingContext context, final IProgressMonitor monitor) {
    return new ResourceTraversal[] { new ResourceTraversal(new IResource[] { fResource }, IResource.DEPTH_INFINITE, IResource.NONE) };
}