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.GroupUserResource;
27 import java.util.List;
29 import com.google.gwt.user.client.Command;
30 import com.google.gwt.user.client.ui.PopupPanel;
37 public class RefreshCommand implements Command {
39 final FileMenu.Images newImages;
41 private PopupPanel containerPanel;
44 * @param _containerPanel
45 * @param _newImages the images of all the possible delete dialogs
47 public RefreshCommand(PopupPanel _containerPanel, final FileMenu.Images _newImages) {
48 containerPanel = _containerPanel;
49 newImages = _newImages;
53 public void execute() {
54 containerPanel.hide();
55 if (GSS.get().getCurrentSelection() instanceof FileResource || GSS.get().getCurrentSelection() instanceof List)
56 GSS.get().showFileList(true);
57 else if (GSS.get().getCurrentSelection() instanceof GroupUserResource)
60 DnDTreeItem selectedTreeItem = (DnDTreeItem) GSS.get().getFolders().getCurrent();
61 if(selectedTreeItem != null){
62 GSS.get().getFolders().updateFolder(selectedTreeItem);
63 GSS.get().showFileList(true);