X-Git-Url: https://code.grnet.gr/git/pithos-web-client/blobdiff_plain/f1aabd8999c734bfa6c43df49518bf7156ed4161..1eddfbcc470eaa65a225f082d47f0833ca9170c3:/src/gr/grnet/pithos/web/client/FileContextMenu.java?ds=sidebyside diff --git a/src/gr/grnet/pithos/web/client/FileContextMenu.java b/src/gr/grnet/pithos/web/client/FileContextMenu.java index 8f91fbe..7c562f8 100644 --- a/src/gr/grnet/pithos/web/client/FileContextMenu.java +++ b/src/gr/grnet/pithos/web/client/FileContextMenu.java @@ -43,6 +43,7 @@ import gr.grnet.pithos.web.client.commands.RefreshCommand; import gr.grnet.pithos.web.client.commands.RestoreTrashCommand; import gr.grnet.pithos.web.client.commands.ToTrashCommand; import gr.grnet.pithos.web.client.commands.UploadFileCommand; +import gr.grnet.pithos.web.client.foldertree.File; import gr.grnet.pithos.web.client.foldertree.Folder; import gr.grnet.pithos.web.client.rest.resource.FileResource; import gr.grnet.pithos.web.client.rest.resource.FolderResource; @@ -127,7 +128,7 @@ public class FileContextMenu extends PopupPanel { * * @param newImages the image bundle passed on by the parent object */ - public FileContextMenu(Images newImages, Folder selectedFolder, boolean isTrash) { + public FileContextMenu(Images newImages, Folder selectedFolder, List selectedFiles, boolean isTrash) { // The popup's constructor's argument is a boolean specifying that it // auto-close itself when the user clicks outside of it. super(true); @@ -139,7 +140,7 @@ public class FileContextMenu extends PopupPanel { pasteItem = new MenuItem("" + AbstractImagePrototype.create(images.paste()).getHTML() + " Paste", true, new PasteCommand(this)); contextMenu.addItem(pasteItem); - MenuItem upload = new MenuItem("" + AbstractImagePrototype.create(images.fileUpdate()).getHTML() + " Upload", true, new UploadFileCommand(this)); + MenuItem upload = new MenuItem("" + AbstractImagePrototype.create(images.fileUpdate()).getHTML() + " Upload", true, new UploadFileCommand(this, selectedFolder)); contextMenu.addItem(upload); MenuItem refresh = new MenuItem("" + AbstractImagePrototype.create(images.refresh()).getHTML() + " Refresh", true, new RefreshCommand(this, images)); @@ -158,13 +159,10 @@ public class FileContextMenu extends PopupPanel { copyItem = new MenuItem("" + AbstractImagePrototype.create(newImages.copy()).getHTML() + " Copy", true, new CopyCommand(this)); contextMenu.addItem(copyItem); - updateItem = new MenuItem("" + AbstractImagePrototype.create(newImages.fileUpdate()).getHTML() + " Upload", true, new UploadFileCommand(this)); - contextMenu.addItem(updateItem); - trashItem = new MenuItem("" + AbstractImagePrototype.create(newImages.emptyTrash()).getHTML() + " Move to Trash", true, new ToTrashCommand(this)); contextMenu.addItem(trashItem); - deleteItem = new MenuItem("" + AbstractImagePrototype.create(newImages.delete()).getHTML() + " Delete", true, new DeleteCommand(this, null, images)); + deleteItem = new MenuItem("" + AbstractImagePrototype.create(newImages.delete()).getHTML() + " Delete", true, new DeleteCommand(this, selectedFiles, images)); contextMenu.addItem(deleteItem); sharingItem = new MenuItem("" + AbstractImagePrototype.create(newImages.sharing()).getHTML() + " Sharing", true, new PropertiesCommand(this, images, 1)); @@ -173,25 +171,13 @@ public class FileContextMenu extends PopupPanel { propItem = new MenuItem("" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + " Properties", true, new PropertiesCommand(this, images, 0)); contextMenu.addItem(propItem); - - String[] link = {"", ""}; - gss.getTopPanel().getFileMenu().createDownloadLink(link, false); - // The command that does some validation before downloading a file. - Command downloadCmd = new Command() { - + downloadItem = new MenuItem("" + AbstractImagePrototype.create(newImages.download()).getHTML() + " Download", true, new Command() { @Override public void execute() { - hide(); - GSS.get().getTopPanel().getFileMenu().preDownloadCheck(); } - }; - downloadItem = new MenuItem("" + link[0] + AbstractImagePrototype.create(newImages.download()).getHTML() + " Download" + link[1] + "", true, downloadCmd); + }); contextMenu.addItem(downloadItem); - gss.getTopPanel().getFileMenu().createDownloadLink(link, true); - saveAsItem = new MenuItem("" + link[0] + AbstractImagePrototype.create(newImages.download()).getHTML() + " Save As" + link[1] + "", true, downloadCmd); - contextMenu.addItem(saveAsItem); - final Command unselectAllCommand = new Command() { @Override