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;
import java.util.List;
-import com.google.gwt.http.client.URL;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
// 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 != null) {
- Boolean[] permissions = folder.getPermissions().get(app.getUsername());
- boolean canWrite = folder.getOwner().equals(app.getUsername()) || (permissions!= null && permissions[1] != null && permissions[1]);
+ Boolean[] permissions = folder.getPermissions().get(app.getUserID());
+ boolean canWrite = folder.getOwnerID().equals(app.getUserID()) || (permissions!= null && permissions[1] != null && permissions[1]);
boolean isFolderTreeSelected = selectedTree.equals(app.getFolderTreeView());
boolean isMysharedTreeSelected = app.isMySharedSelected();
if (item instanceof List) {
@SuppressWarnings("unchecked")
List<File> _files = (List<File>) item;
- if (_files.get(0).getOwner().equals(folder.getOwner()))
+ if (_files.get(0).getOwnerID().equals(folder.getOwnerID()))
showPaste = true;
}
else {
Folder f = (Folder) item;
- if (f.getOwner().equals(folder.getOwner()))
+ if (f.getOwnerID().equals(folder.getOwnerID()))
showPaste = true;
}
if (showPaste) {
@Override
public void execute() {
for (File f: files)
- Window.open(app.getApiPath() + f.getOwner() + f.getUri(), "_blank", "");
+ Window.open(app.getApiPath() + f.getOwnerID() + f.getUri(), "_blank", "");
}
}));
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;
}