cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [cayenne] 01/02: CAY-2614 Connection test result window shown under other windows
Date Mon, 09 Sep 2019 12:47:55 GMT
This is an automated email from the ASF dual-hosted git repository.

ntimofeev pushed a commit to branch STABLE-4.1
in repository https://gitbox.apache.org/repos/asf/cayenne.git

commit 3ab61a0ebb026ea4f098d93fca44ea6547625f39
Author: Nikita Timofeev <stariy95@gmail.com>
AuthorDate: Thu Sep 5 16:56:13 2019 +0300

    CAY-2614 Connection test result window shown under other windows
---
 RELEASE-NOTES.txt                                                 | 3 ++-
 .../main/java/org/apache/cayenne/modeler/action/SaveAsAction.java | 2 +-
 .../apache/cayenne/modeler/dialog/pref/DataSourcePreferences.java | 8 ++++----
 .../cayenne/modeler/editor/ProcedureParameterTableModel.java      | 4 ++--
 .../cayenne/modeler/editor/dbentity/DbAttributeTableModel.java    | 4 ++--
 5 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index d0a8e56..e3e8cdd 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -36,8 +36,9 @@ CAY-2601 Modeler DbImport: result dialog issues
 CAY-2603 NPE reloading project in the model
 CAY-2605 Modeler: Unable to save - java.nio.file.InvalidPathException
 CAY-2606 Can't resolve obj path with embeddable component
-CAY-2608 CayenneModeler: NPE when reverse engineering with an auto-adapter DataSource
+CAY-2608 Modeler: NPE when reverse engineering with an auto-adapter DataSource
 CAY-2609 Modeler: can't close dbImport result dialog window
+CAY-2614 Modeler: Connection test result window shown under other windows
 
 ----------------------------------
 Release: 4.1.B2
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/SaveAsAction.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/SaveAsAction.java
index e7968a2..d34dead 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/SaveAsAction.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/SaveAsAction.java
@@ -87,7 +87,7 @@ public class SaveAsAction extends CayenneAction {
 
         if (projectDir.exists() && !projectDir.canWrite()) {
             JOptionPane.showMessageDialog(Application.getFrame(), "Can't save project - unable
to write to file \""
-                    + projectDir.getPath() + "\"", "Can't Save Project", JOptionPane.OK_OPTION);
+                    + projectDir.getPath() + "\"", "Can't Save Project", JOptionPane.ERROR_MESSAGE);
             return false;
         }
 
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/DataSourcePreferences.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/DataSourcePreferences.java
index 4dd8d8f..089b598 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/DataSourcePreferences.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/DataSourcePreferences.java
@@ -211,12 +211,12 @@ public class DataSourcePreferences extends CayenneController {
 		}
 
 		if (currentDataSource.getJdbcDriver() == null) {
-			JOptionPane.showMessageDialog(null, "No JDBC Driver specified", "Warning", JOptionPane.WARNING_MESSAGE);
+			JOptionPane.showMessageDialog(view, "No JDBC Driver specified", "Warning", JOptionPane.WARNING_MESSAGE);
 			return;
 		}
 
 		if (currentDataSource.getUrl() == null) {
-			JOptionPane.showMessageDialog(null, "No Database URL specified", "Warning", JOptionPane.WARNING_MESSAGE);
+			JOptionPane.showMessageDialog(view, "No Database URL specified", "Warning", JOptionPane.WARNING_MESSAGE);
 			return;
 		}
 
@@ -273,7 +273,7 @@ public class DataSourcePreferences extends CayenneController {
 				// i guess we can ignore this...
 			}
 
-			JOptionPane.showMessageDialog(null, "Connected Successfully", "Success", JOptionPane.INFORMATION_MESSAGE);
+			JOptionPane.showMessageDialog(view, "Connected Successfully", "Success", JOptionPane.INFORMATION_MESSAGE);
 		} catch (Throwable th) {
 			th = Util.unwindException(th);
 			String message = "Error connecting to DB: " + th.getLocalizedMessage();
@@ -294,7 +294,7 @@ public class DataSourcePreferences extends CayenneController {
 				sbMessage.append(tempString).append(" ");
 			}
 
-			JOptionPane.showMessageDialog(null, sbMessage.toString(), "Warning", JOptionPane.WARNING_MESSAGE);
+			JOptionPane.showMessageDialog(view, sbMessage.toString(), "Warning", JOptionPane.WARNING_MESSAGE);
 		}
 	}
 }
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureParameterTableModel.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureParameterTableModel.java
index b316270..80b4ed5 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureParameterTableModel.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureParameterTableModel.java
@@ -110,7 +110,7 @@ public class ProcedureParameterTableModel extends CayenneTableModel<ProcedurePar
                 parameter.setPrecision(Integer.parseInt(newVal));
             } catch (NumberFormatException ex) {
                 JOptionPane.showMessageDialog(
-                    null,
+                    mediator.getView(),
                     "Invalid precision (" + newVal + "), only numbers are allowed.",
                     "Invalid Precision Value",
                     JOptionPane.ERROR_MESSAGE);
@@ -126,7 +126,7 @@ public class ProcedureParameterTableModel extends CayenneTableModel<ProcedurePar
                 parameter.setMaxLength(Integer.parseInt(newVal));
             } catch (NumberFormatException ex) {
                 JOptionPane.showMessageDialog(
-                        null,
+                        mediator.getView(),
                         "Invalid Max Length (" + newVal + "), only numbers are allowed",
                         "Invalid Maximum Length",
                         JOptionPane.ERROR_MESSAGE);
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbAttributeTableModel.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbAttributeTableModel.java
index ac69a59..111672c 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbAttributeTableModel.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbAttributeTableModel.java
@@ -240,7 +240,7 @@ public class DbAttributeTableModel extends CayenneTableModel<DbAttribute>
{
                 attr.setMaxLength(Integer.parseInt(newVal));
             } catch (NumberFormatException ex) {
                 JOptionPane.showMessageDialog(
-                        null,
+                        mediator.getView(),
                         "Invalid Max Length (" + newVal + "), only numbers are allowed",
                         "Invalid Maximum Length",
                         JOptionPane.ERROR_MESSAGE);
@@ -260,7 +260,7 @@ public class DbAttributeTableModel extends CayenneTableModel<DbAttribute>
{
                 attr.setScale(Integer.parseInt(newVal));
             } catch (NumberFormatException ex) {
                 JOptionPane.showMessageDialog(
-                        null,
+                        mediator.getView(),
                         "Invalid precision (" + newVal + "), only numbers are allowed.",
                         "Invalid Precision Value",
                         JOptionPane.ERROR_MESSAGE);


Mime
View raw message