Repository: cayenne
Updated Branches:
  refs/heads/master 5f510107b -> 6bdef0c5b


CAY-2422 reword message and cleanup


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/6bdef0c5
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/6bdef0c5
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/6bdef0c5

Branch: refs/heads/master
Commit: 6bdef0c5b6b89c557dfa2c61e4281830083816d6
Parents: 5f51010
Author: Nikita Timofeev <stari...@gmail.com>
Authored: Wed Apr 11 14:38:31 2018 +0300
Committer: Nikita Timofeev <stari...@gmail.com>
Committed: Wed Apr 11 14:38:31 2018 +0300

----------------------------------------------------------------------
 .../cayenne/modeler/dialog/db/DataSourceWizard.java  | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/6bdef0c5/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DataSourceWizard.java
----------------------------------------------------------------------
diff --git 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DataSourceWizard.java
 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DataSourceWizard.java
index 0b1ccf7..0e01c35 100644
--- 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DataSourceWizard.java
+++ 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DataSourceWizard.java
@@ -215,13 +215,13 @@ public class DataSourceWizard extends CayenneController {
                                this.adapter = info.makeAdapter(classLoader);
                                this.dataSource = 
info.makeDataSource(classLoader);
                        } catch (SQLException ignore) {
-                               showNoConnectorDialog("Driver is not 
configured!", "You didn't attach the proper driver.");
+                               showNoConnectorDialog("Unable to load driver '" 
+ info.getJdbcDriver() + "'");
                                return;
                        }
 
+                       // Test connection
                        try (Connection connection = 
dataSource.getConnection()) {
-                       } catch (SQLException ignore) {
-                       }
+            }
                } catch (Throwable th) {
                        reportError("Connection Error", th);
                        return;
@@ -297,12 +297,11 @@ public class DataSourceWizard extends CayenneController {
                dataSourceBinding.updateView();
        }
 
-       protected void showNoConnectorDialog(final String title, final String 
message) {
-
-               final String [] options = {"Setup driver", "OK"};
+       protected void showNoConnectorDialog(String message) {
+               final String[] options = {"Setup driver", "Cancel"};
 
-               final int selection = JOptionPane.showOptionDialog(getView(), 
message, title, JOptionPane.ERROR_MESSAGE,
-                               JOptionPane.ERROR_MESSAGE, null, options, 
options[1]);
+               final int selection = JOptionPane.showOptionDialog(getView(), 
message, "Configuration error",
+                               JOptionPane.OK_CANCEL_OPTION, 
JOptionPane.ERROR_MESSAGE, null, options, options[0]);
                if (selection == 0) {
                        classPathConfigAction();
                }

Reply via email to