use of org.jkiss.dbeaver.model.sql.SQLHelpProvider in project dbeaver by serge-rider.
the class SQLContextInformer method readDataSourceHelp.
private static String readDataSourceHelp(DBRProgressMonitor monitor, DBPDataSource dataSource, DBPKeywordType keywordType, String keyword) {
final SQLHelpProvider helpProvider = DBUtils.getAdapter(SQLHelpProvider.class, dataSource);
if (helpProvider == null) {
return null;
}
final SQLHelpTopic helpTopic = helpProvider.findHelpTopic(monitor, keyword, keywordType);
if (helpTopic == null) {
return null;
}
if (!CommonUtils.isEmpty(helpTopic.getContents())) {
return helpTopic.getContents();
} else if (!CommonUtils.isEmpty(helpTopic.getUrl())) {
return "<a href=\"" + helpTopic.getUrl() + "\">" + keyword + "</a>";
} else {
return null;
}
}
Aggregations