public ConnectionHandler getActiveConnection() {
DatabaseBrowserTree activeBrowserTree = getActiveBrowserTree();
if (activeBrowserTree != null) {
BrowserTreeModel browserTreeModel = activeBrowserTree.getModel();
if (browserTreeModel instanceof TabbedBrowserTreeModel) {
TabbedBrowserTreeModel tabbedBrowserTreeModel = (TabbedBrowserTreeModel) browserTreeModel;
return tabbedBrowserTreeModel.getConnectionHandler();
}
BrowserTreeNode browserTreeNode = activeBrowserTree.getSelectedNode();
if (browserTreeNode != null) {
return browserTreeNode.getConnectionHandler();