Revision f55cf326 web_client/src/gr/grnet/pithos/web/client/FileContextMenu.java
b/web_client/src/gr/grnet/pithos/web/client/FileContextMenu.java | ||
---|---|---|
39 | 39 |
import gr.grnet.pithos.web.client.commands.DeleteCommand; |
40 | 40 |
import gr.grnet.pithos.web.client.commands.PasteCommand; |
41 | 41 |
import gr.grnet.pithos.web.client.commands.PropertiesCommand; |
42 |
import gr.grnet.pithos.web.client.commands.RefreshCommand; |
|
43 |
import gr.grnet.pithos.web.client.commands.RestoreTrashCommand; |
|
44 | 42 |
import gr.grnet.pithos.web.client.commands.ToTrashCommand; |
45 | 43 |
import gr.grnet.pithos.web.client.commands.UploadFileCommand; |
46 | 44 |
import gr.grnet.pithos.web.client.foldertree.File; |
47 | 45 |
import gr.grnet.pithos.web.client.foldertree.Folder; |
48 |
import gr.grnet.pithos.web.client.rest.resource.FileResource; |
|
49 |
import gr.grnet.pithos.web.client.rest.resource.FolderResource; |
|
50 |
import gr.grnet.pithos.web.client.rest.resource.RestResource; |
|
51 |
import gr.grnet.pithos.web.client.rest.resource.RestResourceWrapper; |
|
52 |
import gr.grnet.pithos.web.client.rest.resource.TrashFolderResource; |
|
53 | 46 |
|
54 | 47 |
import java.util.List; |
55 | 48 |
|
56 |
import com.google.gwt.event.dom.client.ClickEvent; |
|
57 |
import com.google.gwt.event.dom.client.ClickHandler; |
|
58 |
import com.google.gwt.event.dom.client.ContextMenuEvent; |
|
59 | 49 |
import com.google.gwt.resources.client.ClientBundle; |
60 | 50 |
import com.google.gwt.resources.client.ImageResource; |
61 | 51 |
import com.google.gwt.user.client.Command; |
62 |
import com.google.gwt.user.client.Event; |
|
63 | 52 |
import com.google.gwt.user.client.ui.AbstractImagePrototype; |
64 | 53 |
import com.google.gwt.user.client.ui.MenuBar; |
65 | 54 |
import com.google.gwt.user.client.ui.MenuItem; |
... | ... | |
132 | 121 |
// The popup's constructor's argument is a boolean specifying that it |
133 | 122 |
// auto-close itself when the user clicks outside of it. |
134 | 123 |
super(true); |
135 |
GSS gss = GSS.get();
|
|
124 |
Pithos gss = Pithos.get();
|
|
136 | 125 |
setAnimationEnabled(true); |
137 | 126 |
images = newImages; |
138 | 127 |
MenuBar contextMenu = new MenuBar(true); |
139 | 128 |
|
140 |
if (GSS.get().getClipboard().hasFiles()) {
|
|
141 |
pasteItem = new MenuItem("<span>" + AbstractImagePrototype.create(images.paste()).getHTML() + " Paste</span>", true, new PasteCommand(GSS.get(), this, selectedFolder));
|
|
129 |
if (Pithos.get().getClipboard().hasFiles()) {
|
|
130 |
pasteItem = new MenuItem("<span>" + AbstractImagePrototype.create(images.paste()).getHTML() + " Paste</span>", true, new PasteCommand(Pithos.get(), this, selectedFolder));
|
|
142 | 131 |
contextMenu.addItem(pasteItem); |
143 | 132 |
} |
144 | 133 |
|
... | ... | |
155 | 144 |
// MenuItem delete = new MenuItem("<span>" + AbstractImagePrototype.create(images.delete()).getHTML() + " Delete</span>", true, new DeleteCommand(this, null, images)); |
156 | 145 |
// contextMenu.addItem(delete); |
157 | 146 |
// } else { |
158 |
cutItem = new MenuItem("<span id='fileContextMenu.cut'>" + AbstractImagePrototype.create(newImages.cut()).getHTML() + " Cut</span>", true, new CutCommand(GSS.get(), this, selectedFiles));
|
|
147 |
cutItem = new MenuItem("<span id='fileContextMenu.cut'>" + AbstractImagePrototype.create(newImages.cut()).getHTML() + " Cut</span>", true, new CutCommand(Pithos.get(), this, selectedFiles));
|
|
159 | 148 |
contextMenu.addItem(cutItem); |
160 | 149 |
|
161 |
copyItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + " Copy</span>", true, new CopyCommand(GSS.get(), this, selectedFiles));
|
|
150 |
copyItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + " Copy</span>", true, new CopyCommand(Pithos.get(), this, selectedFiles));
|
|
162 | 151 |
contextMenu.addItem(copyItem); |
163 | 152 |
|
164 |
trashItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.emptyTrash()).getHTML() + " Move to Trash</span>", true, new ToTrashCommand(GSS.get(), this, selectedFiles));
|
|
153 |
trashItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.emptyTrash()).getHTML() + " Move to Trash</span>", true, new ToTrashCommand(Pithos.get(), this, selectedFiles));
|
|
165 | 154 |
contextMenu.addItem(trashItem); |
166 | 155 |
|
167 | 156 |
deleteItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + " Delete</span>", true, new DeleteCommand(this, selectedFiles, images)); |
... | ... | |
170 | 159 |
// sharingItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.sharing()).getHTML() + " Sharing</span>", true, new PropertiesCommand(this, images, 1)); |
171 | 160 |
// contextMenu.addItem(sharingItem); |
172 | 161 |
|
173 |
contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + " Properties</span>", true, new PropertiesCommand(GSS.get(), this, selectedFiles, images, 0)));
|
|
162 |
contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + " Properties</span>", true, new PropertiesCommand(Pithos.get(), this, selectedFiles, images, 0)));
|
|
174 | 163 |
|
175 | 164 |
if (!selectedFiles.isEmpty()) |
176 |
contextMenu.addItem(new MenuItem("<span><a class='hidden-link' href='" + GSS.get().getApiPath() + GSS.get().getUsername() + selectedFiles.get(0).getUri() + "?X-Auth-Token=" + GSS.get().getToken() + "' target='_blank'>" + AbstractImagePrototype.create(newImages.download()).getHTML() + " Download</a></span>", true, (Command) null));
|
|
165 |
contextMenu.addItem(new MenuItem("<span><a class='hidden-link' href='" + Pithos.get().getApiPath() + Pithos.get().getUsername() + selectedFiles.get(0).getUri() + "?X-Auth-Token=" + Pithos.get().getToken() + "' target='_blank'>" + AbstractImagePrototype.create(newImages.download()).getHTML() + " Download</a></span>", true, (Command) null));
|
|
177 | 166 |
|
178 | 167 |
MenuItem unSelect = new MenuItem("<span>" + AbstractImagePrototype.create(images.unselectAll()).getHTML() + " Unselect</span>", true, new Command() { |
179 | 168 |
@Override |
180 | 169 |
public void execute() { |
181 | 170 |
hide(); |
182 |
GSS.get().getFileList().clearSelectedRows();
|
|
171 |
Pithos.get().getFileList().clearSelectedRows();
|
|
183 | 172 |
} |
184 | 173 |
}); |
185 | 174 |
contextMenu.addItem(unSelect); |
Also available in: Unified diff