void createDownloadLink(String[] link, boolean forceDownload) {
String downloadURL = getDownloadURL();
if (!downloadURL.isEmpty()) {
- link[0] = "<a class='hidden-link' href='" + downloadURL
+ link[0] = "<a id ='topMenu.file.download' class='hidden-link' href='" + downloadURL
+ (forceDownload ? "&dl=1" : "") + "' target='_blank'>";
link[1] = "</a>";
}
contextMenu.addItem(newFolderItem);
}
if(uploadVisible){
- MenuItem uploadItem = new MenuItem("<span>" + AbstractImagePrototype.create(images.fileUpdate()).getHTML() + " Upload</span>", true, new UploadFileCommand(this));
- uploadItem.getElement().setId("topMenu.file.upload");
+ MenuItem uploadItem = new MenuItem("<span id='topMenu.file.upload'>" + AbstractImagePrototype.create(images.fileUpdate()).getHTML() + " Upload</span>", true, new UploadFileCommand(this));
contextMenu.addItem(uploadItem);
}
if (downloadVisible) {
MenuItem downloadItem = new MenuItem("<span>" + link[0] + AbstractImagePrototype.create(images.download()).getHTML() + " Download" + link[1] + "</span>", true, downloadCmd);
contextMenu.addItem(downloadItem);
- downloadItem.getElement().setId("topMenu.file.download");
createDownloadLink(link, true);
- MenuItem saveAsItem = new MenuItem("<span>" + link[0] + AbstractImagePrototype.create(images.download()).getHTML() + " Save As" + link[1] + "</span>", true, downloadCmd);
- saveAsItem.getElement().setId("topMenu.file.saveAs");
+ MenuItem saveAsItem = new MenuItem("<span>" + link[0] + AbstractImagePrototype.create(images.download()).getHTML() + " Save As" + link[1] + "</span>", true, downloadCmd);
contextMenu.addItem(saveAsItem);
}
MenuItem emptyTrashItem = new MenuItem("<span>" + AbstractImagePrototype.create(images.emptyTrash()).getHTML() + " Empty Trash</span>", true, new EmptyTrashCommand(this));