Remove the redundant gss top-level directory.
[pithos] / src / gr / ebs / gss / 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.ebs.gss.client.commands;
20
21 import gr.ebs.gss.client.FileMenu;
22 import gr.ebs.gss.client.GSS;
23 import gr.ebs.gss.client.dnd.DnDTreeItem;
24 import gr.ebs.gss.client.rest.resource.FileResource;
25 import gr.ebs.gss.client.rest.resource.GroupResource;
26 import gr.ebs.gss.client.rest.resource.GroupUserResource;
27
28 import java.util.List;
29
30 import com.google.gwt.user.client.Command;
31 import com.google.gwt.user.client.ui.PopupPanel;
32
33
34 /**
35  * @author kman
36  *
37  */
38 public class RefreshCommand implements Command {
39
40         final FileMenu.Images newImages;
41
42         private PopupPanel containerPanel;
43
44         private List<GroupResource> groups = null;
45
46         private List<FileResource> versions = null;
47
48         private int tabToShow = 0;
49
50         /**
51          * @param _containerPanel
52          * @param _newImages the images of all the possible delete dialogs
53          * @param _tab the tab to switch to
54          */
55         public RefreshCommand(PopupPanel _containerPanel, final FileMenu.Images _newImages) {
56                 containerPanel = _containerPanel;
57                 newImages = _newImages;
58         }
59
60         public void execute() {
61                 containerPanel.hide();
62                 if (GSS.get().getCurrentSelection() instanceof FileResource || GSS.get().getCurrentSelection() instanceof List)
63                         GSS.get().showFileList(true);
64                 else if (GSS.get().getCurrentSelection() instanceof GroupUserResource)
65                         return;
66                 else{
67                         DnDTreeItem selectedTreeItem = (DnDTreeItem) GSS.get().getFolders().getCurrent();
68                         if(selectedTreeItem != null){
69                                 GSS.get().getFolders().updateFolder(selectedTreeItem);
70                                 GSS.get().showFileList(true);
71                         }
72                 }
73         }
74
75
76 }