use of org.fife.rsta.ac.LanguageSupport in project knime-core by knime.
the class JavaSnippetNodeDialog method updateAutocompletion.
private void updateAutocompletion() {
final LanguageSupportFactory lsf = LanguageSupportFactory.get();
final LanguageSupport support = lsf.getSupportFor(org.fife.ui.rsyntaxtextarea.SyntaxConstants.SYNTAX_STYLE_JAVA);
final JavaLanguageSupport jls = (JavaLanguageSupport) support;
final JarManager jarManager = jls.getJarManager();
try {
if (m_autoCompletionJars == null || !Arrays.stream(m_autoCompletionJars).allMatch(file -> file.exists()) || !Arrays.equals(m_autoCompletionJars, m_snippet.getCompiletimeClassPath())) {
m_autoCompletionJars = m_snippet.getCompiletimeClassPath();
jarManager.clearClassFileSources();
jarManager.addCurrentJreClassFileSource();
for (final File jarFile : m_autoCompletionJars) {
if (!jarFile.getName().endsWith(".jar")) {
continue;
}
jarManager.addClassFileSource(jarFile);
}
}
} catch (IOException ioe) {
LOGGER.error(ioe.getMessage(), ioe);
}
}
Aggregations