本文整理匯總了Java中org.eclipse.cdt.core.index.IIndexFileLocation類的典型用法代碼示例。如果您正苦於以下問題:Java IIndexFileLocation類的具體用法?Java IIndexFileLocation怎麽用?Java IIndexFileLocation使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
IIndexFileLocation類屬於org.eclipse.cdt.core.index包,在下文中一共展示了IIndexFileLocation類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: waitUntilFileIsIndexed
import org.eclipse.cdt.core.index.IIndexFileLocation; //導入依賴的package包/類
/**
* Waits until the given file is indexed. Fails if this does not happen within the
* given time.
*
* @param file
* @param maxmillis
* @throws Exception
* @since 4.0
*/
public static void waitUntilFileIsIndexed(IIndex index, IFile file, int maxmillis) throws Exception {
long fileTimestamp = file.getLocalTimeStamp();
IIndexFileLocation indexFileLocation = IndexLocationFactory.getWorkspaceIFL(file);
long endTime = System.currentTimeMillis() + maxmillis;
int timeLeft = maxmillis;
while (timeLeft >= 0) {
Assert.assertTrue(CCorePlugin.getIndexManager().joinIndexer(timeLeft, new NullProgressMonitor()));
index.acquireReadLock();
try {
IIndexFile[] files = index.getFiles(ILinkage.CPP_LINKAGE_ID, indexFileLocation);
if (files.length > 0 && areAllFilesNotOlderThan(files, fileTimestamp)) {
Assert.assertTrue(CCorePlugin.getIndexManager().joinIndexer(timeLeft, new NullProgressMonitor()));
return;
}
files = index.getFiles(ILinkage.C_LINKAGE_ID, indexFileLocation);
if (files.length > 0 && areAllFilesNotOlderThan(files, fileTimestamp)) {
Assert.assertTrue(CCorePlugin.getIndexManager().joinIndexer(timeLeft, new NullProgressMonitor()));
return;
}
} finally {
index.releaseReadLock();
}
Thread.sleep(50);
timeLeft = (int) (endTime - System.currentTimeMillis());
}
Assert.fail("Indexing of " + file.getFullPath() + " did not complete in " + maxmillis / 1000. + " sec");
}
示例2: get
import org.eclipse.cdt.core.index.IIndexFileLocation; //導入依賴的package包/類
@Override
public CodeReader get(String string, IIndexFileLocation iifl) throws CoreException, IOException {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}