Updated copyright notice
[pithos] / web_client / src / gr / grnet / pithos / web / client / commands / RefreshCommand.java
1 /*
2  *  Copyright (c) 2011 Greek Research and Technology Network
3  */
4 package gr.grnet.pithos.web.client.commands;
5
6 import gr.grnet.pithos.web.client.FileMenu;
7 import gr.grnet.pithos.web.client.GSS;
8 import gr.grnet.pithos.web.client.rest.resource.FileResource;
9 import gr.grnet.pithos.web.client.rest.resource.GroupUserResource;
10
11 import java.util.List;
12
13 import com.google.gwt.user.client.Command;
14 import com.google.gwt.user.client.ui.PopupPanel;
15
16
17 public class RefreshCommand implements Command {
18
19         final FileMenu.Images newImages;
20
21         private PopupPanel containerPanel;
22
23         /**
24          * @param _containerPanel
25          * @param _newImages the images of all the possible delete dialogs
26          */
27         public RefreshCommand(PopupPanel _containerPanel, final FileMenu.Images _newImages) {
28                 containerPanel = _containerPanel;
29                 newImages = _newImages;
30         }
31
32         @Override
33         public void execute() {
34                 containerPanel.hide();
35                 if (GSS.get().getCurrentSelection() instanceof FileResource || GSS.get().getCurrentSelection() instanceof List)
36                         GSS.get().showFileList(true);
37                 else if (GSS.get().getCurrentSelection() instanceof GroupUserResource)
38                         return;
39                 else{
40                         //TODO:CELLTREE
41                         //DnDTreeItem selectedTreeItem = (DnDTreeItem) GSS.get().getFolders().getCurrent();
42                         //if(selectedTreeItem != null){
43                                 //GSS.get().getFolders().updateFolder(selectedTreeItem);
44                         GSS.get().getTreeView().updateNode(GSS.get().getTreeView().getSelection());
45                                 GSS.get().showFileList(true);
46                         //}
47                 }
48         }
49 }