/** * @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); }
/** @return the description */ public abstract FileInfoMatcherDescription getFileInfoMatcherDescription();
private void createNestedProjectFilter() throws CoreException { IProject project = projectHelper.getProject(); FileInfoMatcherDescription matcherDescription = new FileInfoMatcherDescription( ID, null ); project.createFilter( FILTER_TYPE, matcherDescription, NONE, new NullProgressMonitor() ); }
/** * {@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); }
@Override public IResourceFilterDescription createFilter(int type, FileInfoMatcherDescription matcherDescription, int updateFlags, IProgressMonitor monitor) throws CoreException { throw new RuntimeException("Not implemented"); }