commit 4c69b354095c48253162bb0655bc9bd721a0bcaf
Author: Christos Stathis <chstath@ebs.gr>
Date:   Fri Jul 6 18:37:31 2012 +0300

    No context menu for right-side folders

diff --git a/src/gr/grnet/pithos/web/client/FileContextMenu.java b/src/gr/grnet/pithos/web/client/FileContextMenu.java
index 5d4e031..04f444c 100644
--- a/src/gr/grnet/pithos/web/client/FileContextMenu.java
+++ b/src/gr/grnet/pithos/web/client/FileContextMenu.java
@@ -199,15 +199,13 @@ public class FileContextMenu extends PopupPanel {
 		}
         else {
         	for (FileFolderResource res : selectedFiles) {
-        		if (res instanceof File) {
-        			File f = (File) res;
-	        		permissions = f.getPermissions().get(app.getUsername());
-	        		canWrite &= (f.getOwner().equals(app.getUsername()) || (permissions!= null && permissions[1] != null && permissions[1]));
-        		}
+        		permissions = res.getPermissions().get(app.getUsername());
+        		canWrite &= (res.getOwner().equals(app.getUsername()) || (permissions!= null && permissions[1] != null && permissions[1]));
         	}
         }
         boolean isFolderTreeSelected = selectedTree.equals(app.getFolderTreeView());
         boolean isMysharedSelected = selectedTree.equals(app.getMySharedTreeView());
+//        boolean folderFile = selectedFiles.get(0) instanceof Folder;
         if (selectedFolder != null) {
 		    if (!selectedFolder.isInTrash()) {
 		        if (canWrite && app.getClipboard().hasFiles() && !isMysharedSelected) {
@@ -219,26 +217,30 @@ public class FileContextMenu extends PopupPanel {
 			        MenuItem upload = new MenuItem("<span>" + AbstractImagePrototype.create(images.fileUpdate()).getHTML() + "&nbsp;Upload</span>", true, new UploadFileCommand(app, this, selectedFolder));
 			        contextMenu.addItem(upload);
 		        }
-		        if (isFolderTreeSelected || isMysharedSelected) {
+		        if ((isFolderTreeSelected || isMysharedSelected)) {
 					cutItem = new MenuItem("<span id='fileContextMenu.cut'>" + AbstractImagePrototype.create(newImages.cut()).getHTML() + "&nbsp;Cut</span>", true, new CutCommand(app, this, selectedFiles));
 		            contextMenu.addItem(cutItem);
 		        }
 		
-				copyItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + "&nbsp;Copy</span>", true, new CopyCommand(app, this, selectedFiles));
-		        contextMenu.addItem(copyItem);
+//		        if (!folderFile) {
+		        	copyItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + "&nbsp;Copy</span>", true, new CopyCommand(app, this, selectedFiles));
+		        	contextMenu.addItem(copyItem);
+//		        }
 		
-		        if (isFolderTreeSelected || isMysharedSelected) {
+		        if ((isFolderTreeSelected || isMysharedSelected)) {
 					trashItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.emptyTrash()).getHTML() + "&nbsp;Move to Trash</span>", true, new ToTrashCommand(app, this, selectedFiles));
 		            contextMenu.addItem(trashItem);
 		        }
 		    }
 		    else {
-				MenuItem restore = new MenuItem("<span>" + AbstractImagePrototype.create(images.versions()).getHTML() + "&nbsp;Restore</span>", true, new RestoreTrashCommand(app, this, selectedFiles));
-				contextMenu.addItem(restore);
+//		        if (!folderFile) {
+					MenuItem restore = new MenuItem("<span>" + AbstractImagePrototype.create(images.versions()).getHTML() + "&nbsp;Restore</span>", true, new RestoreTrashCommand(app, this, selectedFiles));
+					contextMenu.addItem(restore);
+//		        }
 		    }
         }
 
-        if (isFolderTreeSelected || isMysharedSelected) {
+        if ((isFolderTreeSelected || isMysharedSelected)) {
 			deleteItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + "&nbsp;Delete</span>", true, new DeleteCommand(app, this, selectedFiles, MessagePanel.images));
 	        contextMenu.addItem(deleteItem);
         }
@@ -252,17 +254,19 @@ public class FileContextMenu extends PopupPanel {
         	}
 
         }
-	    contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.download()).getHTML() + "&nbsp;Download</span>", true, new Command() {
-			
-			@Override
-			public void execute() {
-				for (FileFolderResource res : selectedFiles)
-					if (res instanceof File) {
-						File f = (File) res;
-						Window.open(app.getApiPath() + f.getOwner() + f.getUri(), "_blank", "");
-					}
-			}
-		}));
+//        if (!folderFile) {
+		    contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.download()).getHTML() + "&nbsp;Download</span>", true, new Command() {
+				
+				@Override
+				public void execute() {
+					for (FileFolderResource res : selectedFiles)
+						if (res instanceof File) {
+							File f = (File) res;
+							Window.open(app.getApiPath() + f.getOwner() + f.getUri(), "_blank", "");
+						}
+				}
+			}));
+//        }
 
 		add(contextMenu);
 	}
