/** * @param iResourceFilterDescription * @return a UIResourceFilterDescription */ public static UIResourceFilterDescription wrap( final IResourceFilterDescription iResourceFilterDescription) { return new UIResourceFilterDescription() { public FileInfoMatcherDescription getFileInfoMatcherDescription() { return iResourceFilterDescription.getFileInfoMatcherDescription(); } public IPath getPath() { return iResourceFilterDescription.getResource().getProjectRelativePath(); } public IProject getProject() { return iResourceFilterDescription.getResource().getProject(); } public int getType() { return iResourceFilterDescription.getType(); } }; }
@Override public IResourceFilterDescription createFilter(int type, FileInfoMatcherDescription matcherDescription, int updateFlags, IProgressMonitor monitor) throws CoreException { // not required return null; }
@Override public IResourceFilterDescription createFilter( int type, FileInfoMatcherDescription matcherDescription, int updateFlags, IProgressMonitor monitor) throws CoreException { throw new UnsupportedOperationException(); }
public void addFileFilter(IProject newProject, String pattern, IProgressMonitor monitor) throws CoreException { FileInfoMatcherDescription matcherDescription = new FileInfoMatcherDescription(FILE_FILTER_ID, pattern); /* ignore the generated files - .project and .gitignore at navigator etc. */ newProject.createFilter(IResourceFilterDescription.EXCLUDE_ALL | IResourceFilterDescription.FILES, matcherDescription, IResource.BACKGROUND_REFRESH, monitor); }
@Override public IResourceFilterDescription[] getFilters() throws CoreException { // not required return new IResourceFilterDescription[] {}; }
@Override public IResourceFilterDescription[] getFilters() throws CoreException { throw new UnsupportedOperationException(); }
/** * {@inheritDoc} */ @Override public IResourceFilterDescription createFilter(final int type, final FileInfoMatcherDescription matcherDescription, final int updateFlags, final IProgressMonitor monitor) throws CoreException { return resource().createFilter(type, matcherDescription, updateFlags, monitor); }
/** * {@inheritDoc} */ @Override public IResourceFilterDescription[] getFilters() throws CoreException { return resource().getFilters(); }
@Override public IResourceFilterDescription createFilter(int type, FileInfoMatcherDescription matcherDescription, int updateFlags, IProgressMonitor monitor) throws CoreException { throw new RuntimeException("Not implemented"); }
@Override public IResourceFilterDescription[] getFilters() throws CoreException { throw new RuntimeException("Not implemented"); }