2 * Copyright 2009 Electronic Business Systems Ltd.
4 * This file is part of GSS.
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.
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.
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/>.
19 package gr.ebs.gss.client.commands;
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;
28 import java.util.List;
30 import com.google.gwt.user.client.Command;
31 import com.google.gwt.user.client.ui.PopupPanel;
38 public class RefreshCommand implements Command {
40 final FileMenu.Images newImages;
42 private PopupPanel containerPanel;
44 private List<GroupResource> groups = null;
46 private List<FileResource> versions = null;
48 private int tabToShow = 0;
51 * @param _containerPanel
52 * @param _newImages the images of all the possible delete dialogs
53 * @param _tab the tab to switch to
55 public RefreshCommand(PopupPanel _containerPanel, final FileMenu.Images _newImages) {
56 containerPanel = _containerPanel;
57 newImages = _newImages;
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)
67 DnDTreeItem selectedTreeItem = (DnDTreeItem) GSS.get().getFolders().getCurrent();
68 if(selectedTreeItem != null){
69 GSS.get().getFolders().updateFolder(selectedTreeItem);
70 GSS.get().showFileList(true);