Example usage for org.eclipse.jdt.core.search SearchDocument setParser

List of usage examples for org.eclipse.jdt.core.search SearchDocument setParser

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.search SearchDocument setParser.

Prototype

public void setParser(SourceElementParser sourceElementParser) 

Source Link

Usage

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);
}