/*
- * Copyright 2011 GRNET S.A. All rights reserved.
+ * Copyright 2011-2012 GRNET S.A. All rights reserved.
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
*/
package gr.grnet.pithos.web.client.commands;
-import gr.grnet.pithos.web.client.FileMenu;
import gr.grnet.pithos.web.client.Pithos;
-import gr.grnet.pithos.web.client.rest.resource.FileResource;
-import gr.grnet.pithos.web.client.rest.resource.GroupUserResource;
-
-import java.util.List;
+import gr.grnet.pithos.web.client.foldertree.Folder;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.ui.PopupPanel;
public class RefreshCommand implements Command {
- final FileMenu.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 FileMenu.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();
+ if (app.getSelectedTree().equals(app.getMySharedTreeView()))
+ app.updateSharedFolder(folder, true);
+ else
+ app.updateFolder(folder, true, new Command() {
+
+ @Override
+ public void execute() {
+ app.updateStatistics();
+ }
+ }, true);
}
}