Removed animation that is broken by latest chrome (v.24)
[pithos-web-client] / src / gr / grnet / pithos / web / client / ToolsMenu.java
index 3da9ed1..c70c5c0 100644 (file)
@@ -40,7 +40,7 @@ import gr.grnet.pithos.web.client.commands.CreateGroupCommand;
 import gr.grnet.pithos.web.client.commands.CutCommand;
 import gr.grnet.pithos.web.client.commands.DeleteCommand;
 import gr.grnet.pithos.web.client.commands.DeleteGroupCommand;
-import gr.grnet.pithos.web.client.commands.EmptyTrashCommand;
+import gr.grnet.pithos.web.client.commands.EmptyContainerCommand;
 import gr.grnet.pithos.web.client.commands.PasteCommand;
 import gr.grnet.pithos.web.client.commands.PropertiesCommand;
 import gr.grnet.pithos.web.client.commands.RemoveUserCommand;
@@ -92,7 +92,6 @@ public class ToolsMenu extends PopupPanel {
                // The popup's constructor's argument is a boolean specifying that it
                // auto-close itself when the user clicks outside of it.
                super(true);
-               setAnimationEnabled(true);
                images = newImages;
         MenuBar contextMenu = new MenuBar(true);
 
@@ -105,7 +104,7 @@ public class ToolsMenu extends PopupPanel {
                if (!folder.isInTrash()) {
                        if (canWrite) {
 
-                               if (isFolderTreeSelected) {
+                               if (isFolderTreeSelected || isMysharedTreeSelected) {
                                        MenuItem cut = null;
                                        if (files != null && !files.isEmpty()) {
                                                        cut = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.cut()).getHTML() + "&nbsp;Cut files</span>", true, new CutCommand(app, this, files));
@@ -120,16 +119,14 @@ public class ToolsMenu extends PopupPanel {
                                }
                        }
        
-                       if (!isMysharedTreeSelected) {
-                               MenuItem copy = null;
-                               if (files != null && !files.isEmpty())
-                                       copy = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + "&nbsp;Copy files</span>", true, new CopyCommand(app, this, files));
-                               else if (isFolderTreeSelected && !folder.isContainer())
-                                       copy = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + "&nbsp;Copy folder</span>", true, new CopyCommand(app, this, folder));
-                               if (copy != null) {
-                                       contextMenu.addItem(copy);
-                                       empty = false;
-                               }
+                       MenuItem copy = null;
+                       if (files != null && !files.isEmpty())
+                               copy = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + "&nbsp;Copy files</span>", true, new CopyCommand(app, this, files));
+                       else if (isFolderTreeSelected && !folder.isContainer())
+                               copy = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + "&nbsp;Copy folder</span>", true, new CopyCommand(app, this, folder));
+                       if (copy != null) {
+                               contextMenu.addItem(copy);
+                               empty = false;
                        }
                
                        if (canWrite) {
@@ -154,7 +151,7 @@ public class ToolsMenu extends PopupPanel {
                                        }
                                }
        
-                                   if (isFolderTreeSelected) {
+                                   if (isFolderTreeSelected || isMysharedTreeSelected) {
                                        MenuItem moveToTrash = null;
                                        if (files != null && !files.isEmpty()) {
                                                moveToTrash = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.emptyTrash()).getHTML() + "&nbsp;Move files to Trash</span>", true, new ToTrashCommand(app, this, files));
@@ -183,8 +180,7 @@ public class ToolsMenu extends PopupPanel {
                                                contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + "&nbsp;File properties</span>", true, new PropertiesCommand(app, this, files, PropertiesCommand.PROPERTIES)));
                                                contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.group()).getHTML() + "&nbsp;Sharing</span>", true, new PropertiesCommand(app, this, files, PropertiesCommand.PERMISSIONS)));
                                                contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.internet()).getHTML() + "&nbsp;Publish</span>", true, new PropertiesCommand(app, this, files, PropertiesCommand.PUBLISH)));
-                                               if (!isMysharedTreeSelected)
-                                                       contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.versions()).getHTML() + "&nbsp;Versions</span>", true, new PropertiesCommand(app, this, files, PropertiesCommand.VERSIONS)));
+                                               contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.versions()).getHTML() + "&nbsp;Versions</span>", true, new PropertiesCommand(app, this, files, PropertiesCommand.VERSIONS)));
                                                empty = false;
                                        }
                                        else if (!folder.isContainer()) {
@@ -204,6 +200,11 @@ public class ToolsMenu extends PopupPanel {
                                                }));
                                        empty = false;
                                }
+                               if (isFolderTreeSelected && folder.isContainer()) {
+                                       MenuItem emptyContainer = new MenuItem("<span>Empty Container</span>", true, new EmptyContainerCommand(app, this, folder));
+                                       contextMenu.addItem(emptyContainer);
+                                       empty = false;
+                               }
                        }
                }
                else {
@@ -220,7 +221,7 @@ public class ToolsMenu extends PopupPanel {
                                empty = false;
                        }
                        else {
-                               MenuItem emptyTrash = new MenuItem("<span>" + AbstractImagePrototype.create(images.emptyTrash()).getHTML() + "&nbsp;Empty Trash</span>", true, new EmptyTrashCommand(app, this));
+                               MenuItem emptyTrash = new MenuItem("<span>" + AbstractImagePrototype.create(images.emptyTrash()).getHTML() + "&nbsp;Empty Trash</span>", true, new EmptyContainerCommand(app, this, folder));
                                contextMenu.addItem(emptyTrash);
                                empty = false;
                        }