cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r768317 - in /cayenne/main/trunk: docs/doc/src/main/resources/RELEASE-NOTES.txt framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/DataSourcePreferences.java
Date Fri, 24 Apr 2009 14:14:35 GMT
Author: aadamchik
Date: Fri Apr 24 14:14:35 2009
New Revision: 768317

URL: http://svn.apache.org/viewvc?rev=768317&view=rev
Log:
CAY-1211 Modeler: blown out warning dialogs

patch by Olga Tkachova - the error text is neatly wrapped now

Modified:
    cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/DataSourcePreferences.java

Modified: cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt?rev=768317&r1=768316&r2=768317&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt Fri Apr 24 14:14:35 2009
@@ -33,6 +33,7 @@
 CAY-1175 Replace String column name capitalization property with an enum
 CAY-1184 Callback methods should default to usable names
 CAY-1185 Expression API: boolean support in string representation
+CAY-1211 Modeler: blown out warning dialogs
 
 Bug Fixes Since M5:
 

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/DataSourcePreferences.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/DataSourcePreferences.java?rev=768317&r1=768316&r2=768317&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/DataSourcePreferences.java
(original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/DataSourcePreferences.java
Fri Apr 24 14:14:35 2009
@@ -25,6 +25,7 @@
 import java.sql.SQLException;
 import java.util.Arrays;
 import java.util.Map;
+import java.util.StringTokenizer;
 
 import javax.swing.DefaultComboBoxModel;
 import javax.swing.JOptionPane;
@@ -240,8 +241,29 @@
         }
         catch (Throwable th) {
             th = Util.unwindException(th);
-            JOptionPane.showMessageDialog(null, "Error connecting to DB: "
-                    + th.getLocalizedMessage(), "Warning", JOptionPane.WARNING_MESSAGE);
+            String message = "Error connecting to DB: " + th.getLocalizedMessage();
+
+            StringTokenizer st = new StringTokenizer(message);
+            StringBuilder sbMessage = new StringBuilder();
+            int len = 0;
+            
+            String tempString;
+            while (st.hasMoreTokens()) {
+                tempString = st.nextElement().toString();
+                if(len < 110){
+                    len = len + tempString.length() + 1;
+                } else {
+                    sbMessage.append("\n");
+                    len = 0;
+                }
+                sbMessage.append(tempString + " ");
+            }
+
+            JOptionPane.showMessageDialog(
+                    null,
+                    sbMessage.toString(),
+                    "Warning",
+                    JOptionPane.WARNING_MESSAGE);
             return;
         }
     }



Mime
View raw message