Search in sources :

Example 1 with AnalyzerDescriptor

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;
}
Also used : AnalyzerDescriptor(org.eclipse.help.internal.search.AnalyzerDescriptor) SearchIndex(org.eclipse.help.internal.search.SearchIndex) LocalSearchManager(org.eclipse.help.internal.search.LocalSearchManager) Method(java.lang.reflect.Method)

Aggregations

Method (java.lang.reflect.Method)1 AnalyzerDescriptor (org.eclipse.help.internal.search.AnalyzerDescriptor)1 LocalSearchManager (org.eclipse.help.internal.search.LocalSearchManager)1 SearchIndex (org.eclipse.help.internal.search.SearchIndex)1