Example usage for org.eclipse.jdt.core.search SearchParticipant getDocument

List of usage examples for org.eclipse.jdt.core.search SearchParticipant getDocument

Introduction

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

Prototype

public abstract SearchDocument getDocument(String documentPath);

Source Link

Document

Returns a search document for the given path.

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
 *///  www  . ja  v a  2s .c  o m
public void addBinary(IFile resource, IPath containerPath) {
    if (JavaCore.getPlugin() == null)
        return;
    SearchParticipant participant = SearchEngine.getDefaultSearchParticipant();
    SearchDocument document = participant.getDocument(resource.getFullPath().toString());
    IPath indexLocation = computeIndexLocation(containerPath);
    scheduleDocumentIndexing(document, containerPath, indexLocation, participant);
}

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
 *///  w w w.  j ava2 s.  c om
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);
}