Search in sources :

Example 1 with SQLHelpProvider

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;
    }
}
Also used : SQLHelpProvider(org.jkiss.dbeaver.model.sql.SQLHelpProvider) SQLHelpTopic(org.jkiss.dbeaver.model.sql.SQLHelpTopic)

Aggregations

SQLHelpProvider (org.jkiss.dbeaver.model.sql.SQLHelpProvider)1 SQLHelpTopic (org.jkiss.dbeaver.model.sql.SQLHelpTopic)1