List of usage examples for org.eclipse.jdt.core.search SearchDocument setParser
public void setParser(SourceElementParser sourceElementParser)
From source file:org.eclipse.jdt.internal.core.search.indexing.IndexManager.java
License:Open Source License
/** * Trigger addition of a resource to an index * Note: the actual operation is performed in background *//*from w ww. j av a2 s .c o m*/ 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); IPath indexLocation = computeIndexLocation(containerPath); scheduleDocumentIndexing(document, containerPath, indexLocation, participant); }