Renamed all packages to gr.grnet.pithos.*
[pithos] / web_client / src / gr / grnet / pithos / web / client / commands / RefreshCommand.java
1 /*
2  * Copyright 2009 Electronic Business Systems Ltd.
3  *
4  * This file is part of GSS.
5  *
6  * GSS is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * GSS is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with GSS.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 package gr.grnet.pithos.web.client.commands;
20
21 import gr.grnet.pithos.web.client.FileMenu;
22 import gr.grnet.pithos.web.client.GSS;
23 import gr.grnet.pithos.web.client.rest.resource.FileResource;
24 import gr.grnet.pithos.web.client.rest.resource.GroupUserResource;
25
26 import java.util.List;
27
28 import com.google.gwt.user.client.Command;
29 import com.google.gwt.user.client.ui.PopupPanel;
30
31
32 /**
33  * @author kman
34  *
35  */
36 public class RefreshCommand implements Command {
37
38         final FileMenu.Images newImages;
39
40         private PopupPanel containerPanel;
41
42         /**
43          * @param _containerPanel
44          * @param _newImages the images of all the possible delete dialogs
45          */
46         public RefreshCommand(PopupPanel _containerPanel, final FileMenu.Images _newImages) {
47                 containerPanel = _containerPanel;
48                 newImages = _newImages;
49         }
50
51         @Override
52         public void execute() {
53                 containerPanel.hide();
54                 if (GSS.get().getCurrentSelection() instanceof FileResource || GSS.get().getCurrentSelection() instanceof List)
55                         GSS.get().showFileList(true);
56                 else if (GSS.get().getCurrentSelection() instanceof GroupUserResource)
57                         return;
58                 else{
59                         //TODO:CELLTREE
60                         //DnDTreeItem selectedTreeItem = (DnDTreeItem) GSS.get().getFolders().getCurrent();
61                         //if(selectedTreeItem != null){
62                                 //GSS.get().getFolders().updateFolder(selectedTreeItem);
63                         GSS.get().getTreeView().updateNode(GSS.get().getTreeView().getSelection());
64                                 GSS.get().showFileList(true);
65                         //}
66                 }
67         }
68 }