use of org.jkiss.dbeaver.model.IDataSourceContainerProviderEx in project dbeaver by dbeaver.
the class DataSourceInvalidateHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
DBCExecutionContext context = getActiveExecutionContext(event, false);
if (context != null) {
invalidateDataSource(context.getDataSource());
} else {
IEditorPart editor = HandlerUtil.getActiveEditor(event);
if (editor instanceof IDataSourceContainerProviderEx) {
// Try to set the same container.
// It should trigger connection instantiation if for some reason it was lost (SQLEditor specific?)
DBPDataSourceContainer dsContainer = ((IDataSourceContainerProviderEx) editor).getDataSourceContainer();
if (dsContainer != null) {
((IDataSourceContainerProviderEx) editor).setDataSourceContainer(null);
((IDataSourceContainerProviderEx) editor).setDataSourceContainer(dsContainer);
}
}
}
return null;
}
use of org.jkiss.dbeaver.model.IDataSourceContainerProviderEx in project dbeaver by serge-rider.
the class DataSourceInvalidateHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
DBCExecutionContext context = getActiveExecutionContext(event, false);
if (context != null) {
invalidateDataSource(context.getDataSource());
} else {
IEditorPart editor = HandlerUtil.getActiveEditor(event);
if (editor instanceof IDataSourceContainerProviderEx) {
// Try to set the same container.
// It should trigger connection instantiation if for some reason it was lost (SQLEditor specific?)
DBPDataSourceContainer dsContainer = ((IDataSourceContainerProviderEx) editor).getDataSourceContainer();
if (dsContainer != null) {
((IDataSourceContainerProviderEx) editor).setDataSourceContainer(null);
((IDataSourceContainerProviderEx) editor).setDataSourceContainer(dsContainer);
}
}
}
return null;
}
Aggregations