private boolean isContextChanged(DBPEvent event) {
        DBPEvent.Action eventAction = event.getAction();
        DBSObject eventObject = event.getObject();
        boolean isEditorContext = eventObject == this.getDataSourceContainer() || event.getData() == this.getExecutionContext();
        boolean contextChanged = isEditorContext && eventAction.equals(DBPEvent.Action.OBJECT_UPDATE);
        if (!contextChanged && isEditorContext && eventAction.equals(DBPEvent.Action.OBJECT_SELECT) && event.getEnabled()) {
            DBCExecutionContext execContext = this.getExecutionContext();
            if (execContext != null) {
                DBCExecutionContextDefaults<?, ?> ctxDefault = execContext.getContextDefaults();
                if (ctxDefault != null && eventObject != null) {
                    boolean defaultChanged = eventObject == ctxDefault.getDefaultCatalog() || eventObject == ctxDefault.getDefaultSchema();
                    if (lastExecutionContext != executionContext || defaultChanged) {
                        contextChanged = true;
                    }
                }
            }
        }
        return contextChanged;
    }
Build and update icon and title
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java