import gr.ebs.gss.client.rest.RestCommand;
import gr.ebs.gss.client.rest.resource.FileResource;
import gr.ebs.gss.client.rest.resource.GroupUserResource;
+import gr.ebs.gss.client.rest.resource.OtherUserResource;
+import gr.ebs.gss.client.rest.resource.OthersResource;
import gr.ebs.gss.client.rest.resource.RestResource;
+import gr.ebs.gss.client.rest.resource.SharedResource;
+import gr.ebs.gss.client.rest.resource.TrashFolderResource;
+import gr.ebs.gss.client.rest.resource.TrashResource;
import java.util.List;
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>";
}
preDownloadCheck();
}
};
- //TODO: CELLTREE
+ //
RestResource selectedItem = GSS.get().getTreeView().getSelection();
- boolean downloadVisible = true;//GSS.get().getCurrentSelection() != null && GSS.get().getCurrentSelection() instanceof FileResource;
- boolean propertiesVisible = true;//!(selectedItem != null && (folders.isTrash(selectedItem) || folders.isMyShares(selectedItem) || folders.isOthersShared(selectedItem) || selectedItem.getUserObject() instanceof GroupUserResource || GSS.get().getCurrentSelection() instanceof List));
- boolean newFolderVisible = true;//!(selectedItem != null && (folders.isTrash(selectedItem) || folders.isTrashItem(selectedItem) || folders.isMyShares(selectedItem)|| folders.isOthersShared(selectedItem)));
- boolean uploadVisible = true;//!(selectedItem != null && (folders.isTrash(selectedItem) || folders.isTrashItem(selectedItem)|| folders.isMyShares(selectedItem)|| folders.isOthersShared(selectedItem)));
+ boolean downloadVisible = GSS.get().getCurrentSelection() != null && GSS.get().getCurrentSelection() instanceof FileResource;
+ boolean propertiesVisible = !(selectedItem != null && (selectedItem instanceof TrashResource || selectedItem instanceof TrashFolderResource || selectedItem instanceof SharedResource || selectedItem instanceof OthersResource || selectedItem instanceof OtherUserResource
+ //|| folders.isOthersShared(selectedItem) || selectedItem.getUserObject() instanceof GroupUserResource
+ || GSS.get().getCurrentSelection() instanceof List));
+ boolean newFolderVisible = !(selectedItem != null && (selectedItem instanceof TrashResource || selectedItem instanceof TrashFolderResource || selectedItem instanceof SharedResource || selectedItem instanceof OthersResource || selectedItem instanceof OtherUserResource));
+ boolean uploadVisible = !(selectedItem != null && (selectedItem instanceof TrashResource || selectedItem instanceof TrashFolderResource || selectedItem instanceof SharedResource || selectedItem instanceof OthersResource || selectedItem instanceof OtherUserResource));
if(newFolderVisible){
MenuItem newFolderItem = new MenuItem("<span>" + AbstractImagePrototype.create(images.folderNew()).getHTML() + " New Folder</span>", true, new NewFolderCommand(this, images));
newFolderItem.getElement().setId("topMenu.file.newFolder");
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));