/** * Trigger addition of a resource to an index Note: the actual operation is performed in * background */ public void addBinary(IFile resource, IPath containerPath) { // if (JavaCore.getPlugin() == null) return; SearchParticipant participant = SearchEngine.getDefaultSearchParticipant(); SearchDocument document = participant.getDocument(resource.getFullPath().toString()); IndexLocation indexLocation = computeIndexLocation(containerPath); scheduleDocumentIndexing(document, containerPath, indexLocation, participant); }
/** * Trigger addition of a resource to an index Note: the actual operation is performed in * background */ public void addSource(IFile resource, IPath containerPath, SourceElementParser parser) { // if (JavaCore.getPlugin() == null) return; SearchParticipant participant = SearchEngine.getDefaultSearchParticipant(); SearchDocument document = participant.getDocument(resource.getFullPath().toString()); document.setParser(parser); IndexLocation indexLocation = computeIndexLocation(containerPath); scheduleDocumentIndexing(document, containerPath, indexLocation, participant); }
public void indexDocument( SearchDocument searchDocument, SearchParticipant searchParticipant, Index index, IPath indexLocation) { try { searchDocument.setIndex(index); searchParticipant.indexDocument(searchDocument, indexLocation); } finally { searchDocument.setIndex(null); } }
public void scheduleDocumentIndexing( final SearchDocument searchDocument, IPath container, final IndexLocation indexLocation, final SearchParticipant searchParticipant) { request( new IndexRequest(container, this) { public boolean execute(IProgressMonitor progressMonitor) { if (this.isCancelled || progressMonitor != null && progressMonitor.isCanceled()) return true; /* ensure no concurrent write access to index */ Index index = getIndex( this.containerPath, indexLocation, true, /*reuse index file*/ true /*create if none*/); if (index == null) return true; ReadWriteMonitor monitor = index.monitor; if (monitor == null) return true; // index got deleted since acquired try { monitor.enterWrite(); // ask permission to write indexDocument( searchDocument, searchParticipant, index, new Path(indexLocation.getCanonicalFilePath())); } finally { monitor.exitWrite(); // free write lock } return true; } public String toString() { return "indexing " + searchDocument.getPath(); // $NON-NLS-1$ } }); }
public PossibleMatch(MatchLocator locator, IResource resource, Openable openable, SearchDocument document, boolean mustResolve) { this.resource = resource; this.openable = openable; this.document = document; this.nodeSet = new MatchingNodeSet(mustResolve); char[] qualifiedName = getQualifiedName(); if (qualifiedName != null) this.compoundName = CharOperation.splitOn('.', qualifiedName); }
public AbstractIndexer(SearchDocument document) { this.document = document; }
public SourceIndexer(SearchDocument document) { super(document); this.requestor = new SourceIndexerRequestor(this); }
public BinaryIndexer(SearchDocument document) { super(document); }
public SourceIndexer(SearchDocument document) { super(document); }