private int obtainDesiredTabIndex(boolean makeDefault) {
        int tabCount = resultTabs.getItemCount();
        int tabIndex = 0;
        if (!makeDefault) {
            for (int i = tabCount; i > 0; i--) {
                if (resultTabs.getItem(i - 1).getData() instanceof QueryProcessingComponent) {
                    tabIndex = i;
                    break;
                }
            }
        }
        return tabIndex;
    }
Build and update icon and title
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java