public boolean processSQL(boolean newTab, boolean script, boolean executeFromPosition, SQLQueryTransformer transformer,
        @Nullable SQLQueryListener queryListener
    ) {
        IDocument document = getDocument();
        if (document == null) {
            setStatus(SQLEditorMessages.editors_sql_status_cant_obtain_document, DBPMessageType.ERROR);
            return false;
        }

        // Notify listeners
        synchronized (listeners) {
            for (SQLEditorListener listener : listeners) {
                listener.beforeQueryExecute(script, newTab);
            }
        }

        List<SQLScriptElement> elements;
        ITextSelection selection = (ITextSelection) getSelectionProvider().getSelection();
        // if we select several queries and press Run, they're intentionally goes into one SQLQuery
        // it's a workaround for cases where we can't correctly parse whole query
        // like in package declarations with multiple statements in body
        if (script) {
            if (executeFromPosition) {
                // Get all queries from the current position
                elements = extractScriptQueries(selection.getOffset(), document.getLength(), true, false, true);
                // Replace first query with query under cursor for case if the cursor is in the middle of the query
                elements.remove(0);
                elements.add(0, extractActiveQuery());
            } else {
                // Execute all SQL statements consequently
                if (selection != null && selection.getLength() > 1) {
                    elements = extractScriptQueries(selection.getOffset(), selection.getLength(), true, false, true);
                } else {
                    elements = extractScriptQueries(0, document.getLength(), true, false, true);
                }
            }
        } else {
            // Execute statement under cursor or selected text (if selection present)
            SQLScriptElement sqlQuery = extractActiveQuery();
            if (sqlQuery == null) {
                ResultSetViewer activeViewer = getActiveResultSetViewer();
                if (activeViewer != null) {
                    activeViewer.setStatus(SQLEditorMessages.editors_sql_status_empty_query_string, DBPMessageType.ERROR);
                }
                return false;
            } else {
                elements = Collections.singletonList(sqlQuery);
            }
        }
        try {
            if (transformer != null) {
                DBPDataSource dataSource = getDataSource();
                if (dataSource != null) {
                    List<SQLScriptElement> xQueries = new ArrayList<>(elements.size());
                    for (SQLScriptElement element : elements) {
                        if (element instanceof SQLQuery) {
                            SQLQuery query = transformer.transformQuery(dataSource, getSyntaxManager(), (SQLQuery) element);
                            if (!CommonUtils.isEmpty(query.getParameters())) {
                                query.setParameters(parseQueryParameters(query));
                            }
                            xQueries.add(query);
                        } else {
                            xQueries.add(element);
                        }
                    }
                    elements = xQueries;
                }
            }
        } catch (DBException e) {
            DBWorkbench.getPlatformUI().showError("Bad query", "Can't execute query", e);
            return false;
        }
        if (!CommonUtils.isEmpty(elements)) {
            return processQueries(elements, script, newTab, false, true, queryListener, null);
        } else {
            return false;
        }
    }
Obtain the add-in instance by its concrete type
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java