diff --git a/plugins/org.jkiss.dbeaver.core/plugin.properties b/plugins/org.jkiss.dbeaver.core/plugin.properties index 4afb359b81e56c3d056c68346cb36535a6d6854f..ed88d1541f1337fde65bcce8afc81c35641f6a91 100644 --- a/plugins/org.jkiss.dbeaver.core/plugin.properties +++ b/plugins/org.jkiss.dbeaver.core/plugin.properties @@ -66,6 +66,8 @@ command.org.jkiss.dbeaver.core.connect.name=Connect command.org.jkiss.dbeaver.core.connect.description=Connect to database command.org.jkiss.dbeaver.core.disconnect.name=Disconnect command.org.jkiss.dbeaver.core.disconnect.description=Disconnect from database +command.org.jkiss.dbeaver.core.disconnect.all.name=Disconnect All +command.org.jkiss.dbeaver.core.disconnect.all.description=Close all open connections command.org.jkiss.dbeaver.core.invalidate.name=Invalidate/Reconnect command.org.jkiss.dbeaver.core.invalidate.description=Invalidate/reconnect database connection command.org.jkiss.dbeaver.core.commit.name=Commit diff --git a/plugins/org.jkiss.dbeaver.core/plugin.xml b/plugins/org.jkiss.dbeaver.core/plugin.xml index c917ec83c5aeab901704f5fe65dbf5a4108450fa..3224de44467723282f1e83c7d078c8a5c24c4c02 100644 --- a/plugins/org.jkiss.dbeaver.core/plugin.xml +++ b/plugins/org.jkiss.dbeaver.core/plugin.xml @@ -202,6 +202,7 @@ + @@ -635,6 +636,7 @@ + @@ -1504,6 +1506,7 @@ + diff --git a/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/actions/datasource/DataSourceDisconnectAllHandler.java b/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/actions/datasource/DataSourceDisconnectAllHandler.java new file mode 100644 index 0000000000000000000000000000000000000000..b9d47a0ef3b5bb43e66aacbfef1eb3d6b3cec100 --- /dev/null +++ b/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/actions/datasource/DataSourceDisconnectAllHandler.java @@ -0,0 +1,38 @@ +/* + * DBeaver - Universal Database Manager + * Copyright (C) 2010-2016 Serge Rieder (serge@jkiss.org) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License (version 2) + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.jkiss.dbeaver.ui.actions.datasource; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.jkiss.dbeaver.registry.DataSourceDescriptor; +import org.jkiss.dbeaver.ui.actions.AbstractDataSourceHandler; + +public class DataSourceDisconnectAllHandler extends AbstractDataSourceHandler +{ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException + { + for (final DataSourceDescriptor dataSourceContainer : DataSourceDescriptor.getAllDataSources()) { + if (dataSourceContainer.isConnected()) { + DataSourceHandler.disconnectDataSource(dataSourceContainer, null); + } + } + return null; + } + +} \ No newline at end of file