use of org.eclipse.help.internal.search.AnalyzerDescriptor in project tdi-studio-se by Talend.
the class TalendPaletteSearchIndex method getInstance.
public static TalendPaletteSearchIndex getInstance() {
if (instance != null) {
return instance;
}
LocalSearchManager localSearchManager = BaseHelpSystem.getInstance().getLocalSearchManager();
Method getAnalyzer;
try {
f_locale = SearchIndex.class.getDeclaredField("locale");
f_locale.setAccessible(true);
f_indexDir = SearchIndex.class.getDeclaredField("indexDir");
f_indexDir.setAccessible(true);
getAnalyzer = localSearchManager.getClass().getDeclaredMethod("getAnalyzer", String.class);
getAnalyzer.setAccessible(true);
Object analyzerObj = getAnalyzer.invoke(localSearchManager, locale);
AnalyzerDescriptor analyzer = null;
if (analyzerObj != null) {
analyzer = (AnalyzerDescriptor) analyzerObj;
instance = new TalendPaletteSearchIndex(locale, analyzer, HelpPlugin.getTocManager());
}
} catch (Throwable e) {
CommonExceptionHandler.process(e);
}
return instance;
}
Aggregations