Revision ad8b38cb
b/gss/src/gr/ebs/gss/client/FileContextMenu.java | ||
---|---|---|
23 | 23 |
import gr.ebs.gss.client.commands.DeleteCommand; |
24 | 24 |
import gr.ebs.gss.client.commands.PasteCommand; |
25 | 25 |
import gr.ebs.gss.client.commands.PropertiesCommand; |
26 |
import gr.ebs.gss.client.commands.RefreshCommand; |
|
26 | 27 |
import gr.ebs.gss.client.commands.RestoreTrashCommand; |
27 | 28 |
import gr.ebs.gss.client.commands.ToTrashCommand; |
28 | 29 |
import gr.ebs.gss.client.commands.UploadFileCommand; |
... | ... | |
164 | 165 |
contextMenu.addItem("<span>" + images.unselectAll().getHTML() + " Unselect</span>", true, unselectAllCommand); |
165 | 166 |
contextMenu.addItem(trashItem); |
166 | 167 |
contextMenu.addItem(deleteItem); |
168 |
contextMenu.addItem("<span>" + images.refresh().getHTML() + " Refresh</span>", true, new RefreshCommand(this, images)); |
|
167 | 169 |
contextMenu.addItem(sharingItem); |
168 | 170 |
contextMenu.addItem(propItem); |
169 | 171 |
} |
b/gss/src/gr/ebs/gss/client/FileMenu.java | ||
---|---|---|
21 | 21 |
import gr.ebs.gss.client.commands.EmptyTrashCommand; |
22 | 22 |
import gr.ebs.gss.client.commands.NewFolderCommand; |
23 | 23 |
import gr.ebs.gss.client.commands.PropertiesCommand; |
24 |
import gr.ebs.gss.client.commands.RefreshCommand; |
|
24 | 25 |
import gr.ebs.gss.client.commands.UploadFileCommand; |
25 | 26 |
import gr.ebs.gss.client.rest.RestCommand; |
26 | 27 |
import gr.ebs.gss.client.rest.resource.FileResource; |
... | ... | |
67 | 68 |
|
68 | 69 |
@Resource("gr/ebs/gss/resources/internet.png") |
69 | 70 |
AbstractImagePrototype sharing(); |
71 |
|
|
72 |
@Resource("gr/ebs/gss/resources/refresh.png") |
|
73 |
AbstractImagePrototype refresh(); |
|
70 | 74 |
} |
71 | 75 |
|
72 | 76 |
final MenuBar contextMenu = new MenuBar(true); |
... | ... | |
149 | 153 |
contextMenu.addItem("<span>" + link[0] + images.download().getHTML() + " Download" + link[1] + "</span>", true, downloadCmd); |
150 | 154 |
} |
151 | 155 |
contextMenu.addItem("<span>" + images.emptyTrash().getHTML() + " Empty Trash</span>", true, new EmptyTrashCommand(this)); |
152 |
|
|
156 |
contextMenu.addItem("<span>" + images.refresh().getHTML() + " Refresh</span>", true, new RefreshCommand(this, images)); |
|
153 | 157 |
contextMenu.addItem("<span>" + images.sharing().getHTML() + " Sharing</span>", true, new PropertiesCommand(this, images, 1)) |
154 | 158 |
.setVisible(!propertiesNotVisible); |
155 | 159 |
contextMenu.addItem("<span>" + images.viewText().getHTML() + " Properties</span>", true, new PropertiesCommand(this, images, 0)) |
b/gss/src/gr/ebs/gss/client/FolderContextMenu.java | ||
---|---|---|
25 | 25 |
import gr.ebs.gss.client.commands.NewFolderCommand; |
26 | 26 |
import gr.ebs.gss.client.commands.PasteCommand; |
27 | 27 |
import gr.ebs.gss.client.commands.PropertiesCommand; |
28 |
import gr.ebs.gss.client.commands.RefreshCommand; |
|
28 | 29 |
import gr.ebs.gss.client.commands.RestoreTrashCommand; |
29 | 30 |
import gr.ebs.gss.client.commands.ToTrashCommand; |
30 | 31 |
import gr.ebs.gss.client.commands.UploadFileCommand; |
... | ... | |
74 | 75 |
|
75 | 76 |
if(selectedItem != null) |
76 | 77 |
if(folders.isTrashItem(selectedItem)){ |
77 |
if (folders.isTrash(selectedItem)) |
|
78 |
if (folders.isTrash(selectedItem)){
|
|
78 | 79 |
contextMenu.addItem("<span>" + newImages.delete().getHTML() + " Empty Trash</span>", true, new EmptyTrashCommand(this)); |
80 |
contextMenu.addItem("<span>" + images.refresh().getHTML() + " Refresh</span>", true, new RefreshCommand(this, images)); |
|
81 |
} |
|
79 | 82 |
else { |
80 | 83 |
contextMenu.addItem("<span>" + newImages.viewText().getHTML() + " Restore folder and contents</span>", true, new RestoreTrashCommand(this)); |
81 | 84 |
contextMenu.addItem("<span>" + newImages.delete().getHTML() + " Delete</span>", true, new DeleteCommand(this, newImages)); |
85 |
contextMenu.addItem("<span>" + images.refresh().getHTML() + " Refresh</span>", true, new RefreshCommand(this, images)); |
|
82 | 86 |
} |
83 | 87 |
} |
84 | 88 |
else if(folders.isFileItem(selectedItem)){ |
... | ... | |
96 | 100 |
contextMenu.addItem("<span>" + newImages.emptyTrash().getHTML() + " Move to Trash</span>", true, new ToTrashCommand(this)); |
97 | 101 |
contextMenu.addItem("<span>" + newImages.delete().getHTML() + " Delete</span>", true, new DeleteCommand(this, newImages)); |
98 | 102 |
} |
103 |
contextMenu.addItem("<span>" + images.refresh().getHTML() + " Refresh</span>", true, new RefreshCommand(this, images)); |
|
99 | 104 |
contextMenu.addItem("<span>" + newImages.sharing().getHTML() + " Sharing</span>", true, new PropertiesCommand(this, newImages, 1)); |
100 | 105 |
contextMenu.addItem("<span>" + newImages.viewText().getHTML() + " Properties</span>", true, new PropertiesCommand(this, newImages, 0)); |
101 | 106 |
} |
... | ... | |
107 | 112 |
contextMenu.addItem(pasteItem); |
108 | 113 |
contextMenu.addItem("<span>" + newImages.emptyTrash().getHTML() + " Move to Trash</span>", true, new ToTrashCommand(this)); |
109 | 114 |
contextMenu.addItem("<span>" + newImages.delete().getHTML() + " Delete</span>", true, new DeleteCommand(this, newImages)); |
115 |
contextMenu.addItem("<span>" + images.refresh().getHTML() + " Refresh</span>", true, new RefreshCommand(this, images)); |
|
110 | 116 |
contextMenu.addItem("<span>" + newImages.viewText().getHTML() + " Properties</span>", true, new PropertiesCommand(this, newImages, 0)); |
111 | 117 |
} |
112 | 118 |
else if(!folders.isOthersShared(selectedItem) && folders.isOthersSharedItem(selectedItem) && !(GSS.get().getCurrentSelection() instanceof OtherUserResource)){ |
... | ... | |
114 | 120 |
contextMenu.addItem("<span>" + newImages.fileUpdate().getHTML() + " Upload</span>", true, new UploadFileCommand(this, images)); |
115 | 121 |
contextMenu.addItem("<span>" + newImages.copy().getHTML() + " Copy</span>", true, new CopyCommand(this)); |
116 | 122 |
contextMenu.addItem(pasteItem); |
123 |
contextMenu.addItem("<span>" + images.refresh().getHTML() + " Refresh</span>", true, new RefreshCommand(this, images)); |
|
117 | 124 |
contextMenu.addItem("<span>" + newImages.viewText().getHTML() + " Properties</span>", true, new PropertiesCommand(this, newImages, 0)); |
118 |
} |
|
125 |
} else if(!selectedItem.equals(folders.getSharesItem())) |
|
126 |
contextMenu.addItem("<span>" + images.refresh().getHTML() + " Refresh</span>", true, new RefreshCommand(this, images)); |
|
119 | 127 |
add(contextMenu); |
120 | 128 |
if (GSS.get().getClipboard().hasFolderOrFileItem()) |
121 | 129 |
pasteItem.setVisible(true); |
b/gss/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 |
} |
Also available in: Unified diff