From 06c6b8f16366cccf17d9a02c44c71f721444e699 Mon Sep 17 00:00:00 2001 From: Pascal Neub Date: Fri, 2 Sep 2022 12:13:40 +0200 Subject: [PATCH] feat: remove netbeans connections from connection selection dialog --- .../SelectConnectionDialogModel.java | 45 ------------------- src/main/resources/META-INF/adito.version | 2 +- 2 files changed, 1 insertion(+), 46 deletions(-) diff --git a/src/main/java/de/adito/liquibase/internal/connection/SelectConnectionDialogModel.java b/src/main/java/de/adito/liquibase/internal/connection/SelectConnectionDialogModel.java index c8d096a..da43c24 100644 --- a/src/main/java/de/adito/liquibase/internal/connection/SelectConnectionDialogModel.java +++ b/src/main/java/de/adito/liquibase/internal/connection/SelectConnectionDialogModel.java @@ -4,13 +4,10 @@ import io.reactivex.rxjava3.core.Observable; import io.reactivex.rxjava3.subjects.BehaviorSubject; import org.jetbrains.annotations.*; -import org.netbeans.api.db.explorer.*; import org.netbeans.api.project.Project; import org.openide.util.*; import javax.swing.*; -import java.io.IOException; -import java.sql.Connection; import java.util.*; import java.util.function.Supplier; @@ -38,10 +35,6 @@ class SelectConnectionDialogModel extends DefaultComboBoxModel SwingUtilities.invokeLater(() -> { _loadAsync(pProject, pPreselectedSourceName); - // Add all unnamed connections - for (DatabaseConnection c : ConnectionManager.getDefault().getConnections()) - availableData.add(new _Item(c)); - // init connections setShowAllConnections(true); @@ -300,44 +293,6 @@ private static class _Item connection = pConnection; } - _Item(@NotNull DatabaseConnection pConnection) - { - connection = new IPossibleConnectionProvider.IPossibleDBConnection() - { - @NotNull - @Override - public String getURL() - { - return pConnection.getDatabaseURL(); - } - - @Nullable - @Override - public String getSourceName() - { - return null; - } - - @Override - public T withJDBCConnection(@NotNull IConnectionFunction pFunction) throws IOException, Ex - { - ConnectionManager.getDefault().showConnectionDialog(pConnection); - Connection jdbcCon = pConnection.getJDBCConnection(); - if (jdbcCon == null) - // should not happen - throw new IOException("Connection could not be read. Maybe it is not connected?"); - return pFunction.apply(jdbcCon); - } - - @NotNull - @Override - public List getTableMetaInfos() - { - return List.of(); // At this point there are no meta infomation availabe - } - }; - } - @Nullable public String getOwner() { diff --git a/src/main/resources/META-INF/adito.version b/src/main/resources/META-INF/adito.version index 08f362f..6d55c1a 100644 --- a/src/main/resources/META-INF/adito.version +++ b/src/main/resources/META-INF/adito.version @@ -1 +1 @@ -2021.2.0 \ No newline at end of file +2022.1.3 \ No newline at end of file