Implemented ability to send error data along with user feedback in case of error
[pithos-web-client] / src / gr / grnet / pithos / web / client / commands / RefreshCommand.java
index 86dcacf..fd034f8 100644 (file)
@@ -34,8 +34,8 @@
  */
 package gr.grnet.pithos.web.client.commands;
 
-import gr.grnet.pithos.web.client.FileContextMenu;
 import gr.grnet.pithos.web.client.Pithos;
+import gr.grnet.pithos.web.client.foldertree.Folder;
 
 import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.ui.PopupPanel;
@@ -43,37 +43,31 @@ import com.google.gwt.user.client.ui.PopupPanel;
 
 public class RefreshCommand implements Command {
 
-       final FileContextMenu.Images newImages;
-
        private PopupPanel containerPanel;
 
-    private Pithos app;
+    Pithos app;
 
+    private Folder folder;
+    
        /**
         * @param _containerPanel
-        * @param _newImages the images of all the possible delete dialogs
         */
-       public RefreshCommand(Pithos _app, PopupPanel _containerPanel, final FileContextMenu.Images _newImages) {
+       public RefreshCommand(Pithos _app, PopupPanel _containerPanel, Folder _folder) {
         app = _app;
                containerPanel = _containerPanel;
-               newImages = _newImages;
+               folder = _folder;
        }
 
        @Override
        public void execute() {
-               containerPanel.hide();
-//             if (app.getCurrentSelection() instanceof FileResource || app.getCurrentSelection() instanceof List)
-//                     app.showFileList(true);
-//             else if (app.getCurrentSelection() instanceof GroupUserResource)
-//                     return;
-//             else{
-//                     //TODO:CELLTREE
-//                     //DnDTreeItem selectedTreeItem = (DnDTreeItem) app.getFolders().getCurrent();
-//                     //if(selectedTreeItem != null){
-//                             //app.getFolders().updateFolder(selectedTreeItem);
-//                     app.getTreeView().updateNode(app.getTreeView().getSelection());
-//                             app.showFileList(true);
-//                     //}
-//             }
+               if (containerPanel != null)
+                       containerPanel.hide();
+               app.updateFolder(folder, true, new Command() {
+                       
+                       @Override
+                       public void execute() {
+                               app.updateStatistics();
+                       }
+               });
        }
 }