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;
// 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);
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() + " Cut files</span>", true, new CutCommand(app, this, files));
}
}
- if (!isMysharedTreeSelected) {
- MenuItem copy = null;
- if (files != null && !files.isEmpty())
- copy = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + " Copy files</span>", true, new CopyCommand(app, this, files));
- else if (isFolderTreeSelected && !folder.isContainer())
- copy = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + " 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() + " Copy files</span>", true, new CopyCommand(app, this, files));
+ else if (isFolderTreeSelected && !folder.isContainer())
+ copy = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + " Copy folder</span>", true, new CopyCommand(app, this, folder));
+ if (copy != null) {
+ contextMenu.addItem(copy);
+ empty = false;
}
if (canWrite) {
}
}
- if (isFolderTreeSelected) {
+ if (isFolderTreeSelected || isMysharedTreeSelected) {
MenuItem moveToTrash = null;
if (files != null && !files.isEmpty()) {
moveToTrash = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.emptyTrash()).getHTML() + " Move files to Trash</span>", true, new ToTrashCommand(app, this, files));
contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + " File properties</span>", true, new PropertiesCommand(app, this, files, PropertiesCommand.PROPERTIES)));
contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.group()).getHTML() + " Sharing</span>", true, new PropertiesCommand(app, this, files, PropertiesCommand.PERMISSIONS)));
contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.internet()).getHTML() + " Publish</span>", true, new PropertiesCommand(app, this, files, PropertiesCommand.PUBLISH)));
- if (!isMysharedTreeSelected)
- contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.versions()).getHTML() + " Versions</span>", true, new PropertiesCommand(app, this, files, PropertiesCommand.VERSIONS)));
+ contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.versions()).getHTML() + " Versions</span>", true, new PropertiesCommand(app, this, files, PropertiesCommand.VERSIONS)));
empty = false;
}
else if (!folder.isContainer()) {
}));
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 {
empty = false;
}
else {
- MenuItem emptyTrash = new MenuItem("<span>" + AbstractImagePrototype.create(images.emptyTrash()).getHTML() + " Empty Trash</span>", true, new EmptyTrashCommand(app, this));
+ MenuItem emptyTrash = new MenuItem("<span>" + AbstractImagePrototype.create(images.emptyTrash()).getHTML() + " Empty Trash</span>", true, new EmptyContainerCommand(app, this, folder));
contextMenu.addItem(emptyTrash);
empty = false;
}