/*
- * Copyright 2011 GRNET S.A. All rights reserved.
+ * Copyright 2011-2012 GRNET S.A. All rights reserved.
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
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;
Boolean[] permissions = folder.getPermissions().get(app.getUsername());
boolean canWrite = folder.getOwner().equals(app.getUsername()) || (permissions!= null && permissions[1] != null && permissions[1]);
boolean isFolderTreeSelected = selectedTree.equals(app.getFolderTreeView());
+ boolean isMysharedTreeSelected = app.isMySharedSelected();
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 (canWrite) {
- if (!app.getClipboard().isEmpty()) {
+ if (!isMysharedTreeSelected && !app.getClipboard().isEmpty()) {
Object item = app.getClipboard().getItem();
boolean showPaste = false;
if (item instanceof List) {
}
}
- 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(delete);
empty = false;
}
-
+ }
+ if (isFolderTreeSelected || isMysharedTreeSelected) {
if (files != null && files.size() == 1) {
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.versions()).getHTML() + " Versions</span>", true, new PropertiesCommand(app, this, files, PropertiesCommand.VERSIONS)));
+ contextMenu.addItem(new MenuItem("<span>" + AbstractImagePrototype.create(newImages.internet()).getHTML() + " Publish</span>", true, new PropertiesCommand(app, this, files, PropertiesCommand.PUBLISH)));
+ 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()) {
@Override
public void execute() {
for (File f: files)
- Window.open(app.getApiPath() + f.getOwner() + f.getUri() + "?X-Auth-Token=" + app.getToken(), "_blank", "");
+ Window.open(app.getApiPath() + f.getOwner() + f.getUri(), "_blank", "");
}
}));
empty = false;
contextMenu.addItem(deleteGroup);
empty = false;
}
- else {
- MenuItem createGroup = new MenuItem("<span>" + AbstractImagePrototype.create(images.group()).getHTML() + " Create Group</span>", true, new CreateGroupCommand(app, this));
- contextMenu.addItem(createGroup);
- empty = false;
- }
}
}
+ MenuItem createGroup = new MenuItem("<span>" + AbstractImagePrototype.create(images.group()).getHTML() + " Create Group</span>", true, new CreateGroupCommand(app, this));
+ contextMenu.addItem(createGroup);
+ empty = false;
add(contextMenu);
}