chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1306425 - in /chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main: java/org/apache/chemistry/opencmis/workbench/ClientHelper.java resources/META-INF/README
Date Wed, 28 Mar 2012 15:32:51 GMT
Author: fmui
Date: Wed Mar 28 15:32:51 2012
New Revision: 1306425

URL: http://svn.apache.org/viewvc?rev=1306425&view=rev
Log:
Workbench: break long error messages

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientHelper.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/META-INF/README

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientHelper.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientHelper.java?rev=1306425&r1=1306424&r2=1306425&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientHelper.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientHelper.java
Wed Mar 28 15:32:51 2012
@@ -117,8 +117,28 @@ public class ClientHelper {
             exceptionName = ((CmisBaseException) ex).getExceptionName();
         }
 
-        JOptionPane.showMessageDialog(parent, exceptionName + ":\n" + ex.getMessage(), "Error",
-                JOptionPane.ERROR_MESSAGE);
+        StringBuilder sb = new StringBuilder(ex.getMessage());
+
+        int width = 80;
+        while (sb.length() > width) {
+            int p = width;
+
+            int x = sb.indexOf(" ", p);
+            if (x < 0 || x > p + 10) {
+                x = sb.indexOf("/", p);
+            }
+            if (x < 0 || x > p + 10) {
+                x = sb.indexOf(":", p);
+            }
+            if (x < 0 || x > p + 10) {
+                x = p;
+            }
+
+            sb.insert(x, '\n');
+            width = x + 80;
+        }
+
+        JOptionPane.showMessageDialog(parent, exceptionName + ":\n" + sb, "Error", JOptionPane.ERROR_MESSAGE);
     }
 
     public static boolean isMacOSX() {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/META-INF/README
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/META-INF/README?rev=1306425&r1=1306424&r2=1306425&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/META-INF/README
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/META-INF/README
Wed Mar 28 15:32:51 2012
@@ -10,9 +10,6 @@ Please see the NOTICE and LICENSE files 
 Get the latest released CMIS Workbench from here:
 http://chemistry.apache.org/java/download.html
 
-Get the latest nightly build from here:
-https://builds.apache.org/job/Chemistry%20-%20OpenCMIS%20-%20install/ws/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/target/
-
 
 
 System properties reference



Mime
View raw message