Refresh the MyShared tree when certain file properties are changed
[pithos-web-client] / src / gr / grnet / pithos / web / client / Pithos.java
index f3b3681..08d6261 100644 (file)
@@ -141,6 +141,10 @@ public class Pithos implements EntryPoint, ResizeHandler {
         groupTreeView.updateGroupNode(group);
     }
 
+    public void updateMySharedRoot() {
+       mysharedTreeView.updateRoot();
+    }
+    
     public void updateSharedFolder(Folder f, boolean showfiles) {
        mysharedTreeView.updateFolder(f, showfiles);
     }
@@ -177,6 +181,8 @@ public class Pithos implements EntryPoint, ResizeHandler {
                ImageResource tools();
        }
 
+       private Throwable error;
+       
        /**
         * The Application Clipboard implementation;
         */
@@ -190,7 +196,7 @@ public class Pithos implements EntryPoint, ResizeHandler {
        /**
         * The panel that contains the various system messages.
         */
-       private MessagePanel messagePanel = new MessagePanel(Pithos.images);
+       private MessagePanel messagePanel = new MessagePanel(this, Pithos.images);
 
        /**
         * The bottom panel that contains the status bar.
@@ -563,6 +569,7 @@ public class Pithos implements EntryPoint, ResizeHandler {
                 @Override
                 public void onError(Throwable t) {
                     GWT.log("Error getting file", t);
+                                       setError(t);
                     if (t instanceof RestException)
                         displayError("Error getting file: " + ((RestException) t).getHttpStatusText());
                     else
@@ -635,6 +642,7 @@ public class Pithos implements EntryPoint, ResizeHandler {
             @Override
             public void onError(Throwable t) {
                 GWT.log("Error getting account", t);
+                               setError(t);
                 if (t instanceof RestException)
                     displayError("Error getting account: " + ((RestException) t).getHttpStatusText());
                 else
@@ -661,6 +669,7 @@ public class Pithos implements EntryPoint, ResizeHandler {
                        @Override
                        public void onError(Throwable t) {
                 GWT.log("Error getting account", t);
+                               setError(t);
                 if (t instanceof RestException)
                     displayError("Error getting account: " + ((RestException) t).getHttpStatusText());
                 else
@@ -697,6 +706,7 @@ public class Pithos implements EntryPoint, ResizeHandler {
             @Override
             public void onError(Throwable t) {
                 GWT.log("Error creating pithos", t);
+                               setError(t);
                 if (t instanceof RestException)
                     displayError("Error creating pithos: " + ((RestException) t).getHttpStatusText());
                 else
@@ -723,6 +733,7 @@ public class Pithos implements EntryPoint, ResizeHandler {
             @Override
             public void onError(Throwable t) {
                 GWT.log("Error creating pithos", t);
+                               setError(t);
                 if (t instanceof RestException)
                     displayError("Error creating pithos: " + ((RestException) t).getHttpStatusText());
                 else
@@ -882,6 +893,7 @@ public class Pithos implements EntryPoint, ResizeHandler {
 
                 @Override
                 public void onError(@SuppressWarnings("unused") Request request, Throwable exception) {
+                       setError(exception);
                     displayError("System error unable to delete folder: " + exception.getMessage());
                 }
             });
@@ -905,6 +917,7 @@ public class Pithos implements EntryPoint, ResizeHandler {
                     @Override
                     public void onError(Throwable t) {
                         GWT.log("", t);
+                                               setError(t);
                         displayError("System error unable to delete folder: " + t.getMessage());
                     }
 
@@ -941,6 +954,7 @@ public class Pithos implements EntryPoint, ResizeHandler {
 
                         @Override
                         public void onError(@SuppressWarnings("unused") Request request, Throwable exception) {
+                               setError(exception);
                             displayError("System error unable to delete folder: " + exception.getMessage());
                         }
                     });
@@ -966,6 +980,7 @@ public class Pithos implements EntryPoint, ResizeHandler {
                 @Override
                 public void onError(Throwable t) {
                     GWT.log("", t);
+                                       setError(t);
                     if (t instanceof RestException) {
                        if (((RestException) t).getHttpStatusCode() != Response.SC_NOT_FOUND)
                                displayError("Unable to delete folder: "+((RestException) t).getHttpStatusText());
@@ -1003,6 +1018,7 @@ public class Pithos implements EntryPoint, ResizeHandler {
                 @Override
                 public void onError(Throwable t) {
                     GWT.log("", t);
+                                       setError(t);
                     if (t instanceof RestException) {
                         displayError("Unable to copy file: " + ((RestException) t).getHttpStatusText());
                     }
@@ -1065,6 +1081,7 @@ public class Pithos implements EntryPoint, ResizeHandler {
                                        @Override
                                        public void onError(Throwable t) {
                                GWT.log("", t);
+                                               setError(t);
                                if (t instanceof RestException) {
                                    displayError("Unable to get folder: " + ((RestException) t).getHttpStatusText());
                                }
@@ -1084,7 +1101,8 @@ public class Pithos implements EntryPoint, ResizeHandler {
             @Override
             public void onError(Throwable t) {
                 GWT.log("", t);
-                if (t instanceof RestException) {
+                               setError(t);
+               if (t instanceof RestException) {
                     displayError("Unable to create folder: " + ((RestException) t).getHttpStatusText());
                 }
                 else
@@ -1215,4 +1233,14 @@ public class Pithos implements EntryPoint, ResizeHandler {
                                Cookies.removeCookie(s, "/");
                Window.Location.assign(Window.Location.getPath());
        }
+
+       public String getErrorData() {
+               if (error != null)
+                       return error.toString();
+               return "";
+       }
+       
+       public void setError(Throwable t) {
+               error = t;
+       }
 }