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

项目:che    文件:JavaElementResourceMapping.java   
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()]);
}
项目: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()]);
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaElementResourceMapping.java   
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()]);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaElementResourceMapping.java   
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()]);
}
项目: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);
  }
}
项目: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-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()]);
}