protected void addAdditionalFilesForValidateEdit(final List roFiles) throws CoreException { IResourceVisitor visitor = new IResourceVisitor() { public boolean visit(IResource resource) throws CoreException { if (resource.isDerived()) return false; switch (resource.getType()) { case IResource.PROJECT : return true; case IResource.FOLDER : return true; case IResource.FILE : if (resource.isReadOnly()) roFiles.add(resource); break; default : break; } return false; } }; clientProject.accept(visitor); }
private List<ValidationInfo> collect(IProject project, final IProgressMonitor monitor) throws CoreException { final List<ValidationInfo> files = new ArrayList<ValidationInfo>(); project.accept(new IResourceVisitor() { public boolean visit(IResource resource) throws CoreException { if (monitor.isCanceled()) { throw new OperationCanceledException(); } if (isInterrupted()) { return false; } if (resource instanceof IFile) { IFile file = (IFile) resource; ValidationProjectBuilder.this.visit(files, file); } else if (resource instanceof IContainer) { if (filtered((IContainer) resource)) { return false; } } return true; } }); return files; }
project.accept(new IResourceVisitor() { @Override public boolean visit(IResource resource) throws CoreException {
protected void fullBuild(final IProgressMonitor monitor) throws CoreException { try { getProject().accept(new ResourceVisitor()); } catch (CoreException e) { } }
public static Map loadDeltas(final IProgressMonitor monitor, final Set enabledValidators, IProject project) throws CoreException { VMDResourceVisitor visitor = getResourceVisitor(monitor, enabledValidators); project.accept(visitor, IResource.DEPTH_INFINITE, true); // true means include phantom // resources return visitor.getResult(); } }
private void moveFiles() throws CoreException { moveResourceMonitor = createSubProgressMonitor(1); IResourceVisitor visitor = getRootResourceVisitor(); clientProject.accept(visitor); }
protected void fullBuild(final IProgressMonitor monitor) throws CoreException { try { getProject().accept(new ResourceVisitor()); } catch (CoreException e) { } }
void index() { time0 = System.currentTimeMillis(); fTLDReferences.clear(); fJARReferences.clear(); fTagDirReferences.clear(); fWebXMLReferences.clear(); try { fProject.accept(new Indexer(), 0); } catch (CoreException e) { Logger.logException(e); } if (_debugIndexTime) Logger.log(Logger.INFO, "indexed " + fProject.getName() + " contents in " + (System.currentTimeMillis() - time0) + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ }
protected void fullBuild(final IProgressMonitor monitor) throws CoreException { try { resetOpenL(); getProject().accept(new OpenlResourceVisitor()); } catch (CoreException e) { } }
public List getWSILResources() { final List result = new ArrayList(); try { getProject().accept(new IResourceProxyVisitor() { public boolean visit(IResourceProxy proxy) throws CoreException { if(proxy.getName().endsWith(WSIL_FILE_EXT)) { IResource file = proxy.requestResource(); IVirtualResource[] vResources = ComponentCore.createResources(file); if (vResources.length > 0 && !result.contains(file)) result.add(file); } return true; } }, IResource.NONE); } catch (CoreException e) { WebServicePlugin.logError(0, e.getMessage(), e); } return result; }
/** * INTERNAL ONLY * Fill project with file resources */ void fill() throws CoreException { if (filled) { return; } IResourceProxyVisitor visitor = new IResourceProxyVisitor() { public boolean visit(IResourceProxy resource) throws CoreException { switch (resource.getType()) { case IResource.PROJECT : case IResource.FOLDER : return true; case IResource.FILE : IFile file = (IFile) resource.requestResource(); if (getJpaFileInternal(file) == null) { createJpaFile(file); } default : return false; } } }; getProject().accept(visitor, IResource.NONE); filled = true; resynch(); }
@Override public boolean canConfigure(IProject project, Set<IPath> ignoredDirectories, IProgressMonitor monitor) { JavaResourceExistsFinder javaResourceFinder = new JavaResourceExistsFinder(ignoredDirectories); try { project.accept(javaResourceFinder); } catch (CoreException ex) { JavaPlugin.log(new Status( IStatus.ERROR, JavaCore.PLUGIN_ID, ex.getMessage(), ex)); return false; } return javaResourceFinder.hasJavaFile(); }
@Override public Collection<ISonarLintFile> files() { List<ISonarLintFile> result = new ArrayList<>(); try { project.accept(new IResourceVisitor() { @Override public boolean visit(IResource resource) throws CoreException { if (!SonarLintUtils.isSonarLintFileCandidate(resource)) { return false; } ISonarLintFile sonarLintFile = Adapters.adapt(resource, ISonarLintFile.class); if (sonarLintFile != null) { result.add(sonarLintFile); } return true; } }); } catch (CoreException e) { SonarLintLogger.get().error("Error collecting files in project " + project.getName(), e); } return result; }
fProject.accept(this, IResource.NONE); monitor.worked(1);
fProject.accept(this, IResource.NONE); monitor.worked(1);
project.accept(visitor); visitor.visit(project); Vector wsddFiles = visitor.getWsddFiles();
protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException { IResourceDelta delta = null; if (kind != FULL_BUILD) delta = getDelta(getProject()); if (delta == null || kind == FULL_BUILD) { // Full build IProject project = getProject(); project.accept(new ResourceVisitor(monitor)); } else { delta.accept(new DeltaVisitor(monitor)); } return EMPTY_LIST; }
/** * @param project * @param monitor * @throws Exception */ public void updateProject(IProject project, IProgressMonitor monitor) throws Exception { if( !isIndexed() ) return; deleteProject(project); if( project.exists() && project.isAccessible() && project.isOpen() ) { IndexWriter w = createIndexWriter(false); resourceCollector.clear(); resourceCollector.setExcludedDirRegExes(excludedDirRegExes); project.accept(resourceCollector); for(IContainer container: resourceCollector.getContainers()) { indexContainer(w, container, monitor); } w.close(); } }
for (IProject p : selectedProjects) { try { p.accept(counter); } catch (CoreException e) {
public ToBeBuilt updateProject(IProject project, IProgressMonitor monitor) throws CoreException { final SubMonitor progress = SubMonitor.convert(monitor, Messages.ToBeBuiltComputer_CollectingReosurces, 1); progress.subTask(Messages.ToBeBuiltComputer_CollectingReosurces); final ToBeBuilt toBeBuilt = doRemoveProject(project, progress.newChild(1)); if (!project.isAccessible()) return toBeBuilt; if (progress.isCanceled()) throw new OperationCanceledException(); project.accept(new IResourceVisitor() { public boolean visit(IResource resource) throws CoreException { if (progress.isCanceled()) throw new OperationCanceledException(); if (resource instanceof IStorage) { return updateStorage(null, toBeBuilt, (IStorage) resource); } if (resource instanceof IFolder) { return isHandled((IFolder)resource); } return true; } }); return toBeBuilt; }