@Override
    public void handleDataSourceEvent(final DBPEvent event) {
        final boolean dsEvent = event.getObject() == getDataSourceContainer();
        final boolean objectEvent = event.getObject() != null && event.getObject().getDataSource() == getDataSource();
        final boolean registryEvent = getDataSourceContainer() != null && event.getData() == getDataSourceContainer().getRegistry();
        if (dsEvent || objectEvent || registryEvent) {
            UIUtils.asyncExec(
                () -> {
                    switch (event.getAction()) {
                        case OBJECT_REMOVE:
                            if (dsEvent) {
                                setDataSourceContainer(null);
                            }
                            break;
                        case OBJECT_UPDATE:
                        case OBJECT_SELECT:
                            if (objectEvent) {
                                setPartName(getEditorName());
                                // Active schema was changed? Update title and tooltip
                                firePropertyChange(IWorkbenchPartConstants.PROP_TITLE);
                            }
                            return;
                        case BEFORE_CONNECT:
                        case AFTER_CONNECT:
                            return;
                        default:
                            break;
                    }
                    updateExecutionContext(null);
                    boolean contextChanged = isContextChanged(event);
                    onDataSourceChange(contextChanged);
                }
            );
        }
    }
Build and update icon and title
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java