root / src / gr / ebs / gss / client / commands / RefreshCommand.java @ 623:66f69a7348ed
History | View | Annotate | Download (2 kB)
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.GroupUserResource; |
26 |
|
27 |
import java.util.List; |
28 |
|
29 |
import com.google.gwt.user.client.Command; |
30 |
import com.google.gwt.user.client.ui.PopupPanel; |
31 |
|
32 |
|
33 |
/**
|
34 |
* @author kman
|
35 |
*
|
36 |
*/
|
37 |
public class RefreshCommand implements Command { |
38 |
|
39 |
final FileMenu.Images newImages;
|
40 |
|
41 |
private PopupPanel containerPanel;
|
42 |
|
43 |
/**
|
44 |
* @param _containerPanel
|
45 |
* @param _newImages the images of all the possible delete dialogs
|
46 |
*/
|
47 |
public RefreshCommand(PopupPanel _containerPanel, final FileMenu.Images _newImages) { |
48 |
containerPanel = _containerPanel; |
49 |
newImages = _newImages; |
50 |
} |
51 |
|
52 |
@Override
|
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) |
58 |
return;
|
59 |
else{
|
60 |
DnDTreeItem selectedTreeItem = (DnDTreeItem) GSS.get().getFolders().getCurrent(); |
61 |
if(selectedTreeItem != null){ |
62 |
GSS.get().getFolders().updateFolder(selectedTreeItem); |
63 |
GSS.get().showFileList(true);
|
64 |
} |
65 |
} |
66 |
} |
67 |
} |