*/
package gr.grnet.pithos.web.client;
-import java.util.List;
-
import gr.grnet.pithos.web.client.commands.CopyCommand;
import gr.grnet.pithos.web.client.commands.CutCommand;
import gr.grnet.pithos.web.client.commands.DeleteCommand;
import gr.grnet.pithos.web.client.commands.NewFolderCommand;
import gr.grnet.pithos.web.client.commands.PasteCommand;
import gr.grnet.pithos.web.client.commands.PropertiesCommand;
+import gr.grnet.pithos.web.client.commands.RefreshCommand;
import gr.grnet.pithos.web.client.commands.RestoreTrashCommand;
import gr.grnet.pithos.web.client.commands.ToTrashCommand;
import gr.grnet.pithos.web.client.foldertree.File;
import gr.grnet.pithos.web.client.foldertree.Folder;
+import java.util.List;
+
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.MenuBar;
import com.google.gwt.user.client.ui.MenuItem;
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 otherSharedTreeSelected = selectedTree.equals(app.getOtherSharedTreeView());
+ if (isFolderTreeSelected || otherSharedTreeSelected) {
+ MenuItem refresh = new MenuItem("<span id = 'folderContextMenu.refresh'>" + AbstractImagePrototype.create(images.refresh()).getHTML() + " Refresh</span>", true, new RefreshCommand(app, this, folder));
+ contextMenu.addItem(refresh);
+ }
+
if (!folder.isInTrash()) {
if (canWrite) {
MenuItem newFolder = new MenuItem("<span id = 'folderContextMenu.newFolder'>" + AbstractImagePrototype.create(newImages.folderNew()).getHTML() + " New Folder</span>", true, new NewFolderCommand(app, this, folder, images));
contextMenu.addItem(emptyTrash);
}
}
-
-// MenuItem refresh = new MenuItem("<span id = 'folderContextMenu.refresh'>" + AbstractImagePrototype.create(images.refresh()).getHTML() + " Refresh</span>", true, new RefreshCommand(this, images));
-// contextMenu.addItem(refresh);
-
-// MenuItem sharing = new MenuItem("<span id = 'folderContextMenu.sharing'>" + AbstractImagePrototype.create(newImages.sharing()).getHTML() + " Sharing</span>", true, new PropertiesCommand(this, newImages, 1));
-// contextMenu.addItem(sharing);
-
-
add(contextMenu);
}
}
*/
package gr.grnet.pithos.web.client.commands;
-import gr.grnet.pithos.web.client.FileContextMenu;
import gr.grnet.pithos.web.client.Pithos;
+import gr.grnet.pithos.web.client.foldertree.Folder;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.ui.PopupPanel;
public class RefreshCommand implements Command {
- final FileContextMenu.Images newImages;
-
private PopupPanel containerPanel;
private Pithos app;
+ private Folder folder;
+
/**
* @param _containerPanel
- * @param _newImages the images of all the possible delete dialogs
*/
- public RefreshCommand(Pithos _app, PopupPanel _containerPanel, final FileContextMenu.Images _newImages) {
+ public RefreshCommand(Pithos _app, PopupPanel _containerPanel, Folder _folder) {
app = _app;
containerPanel = _containerPanel;
- newImages = _newImages;
+ folder = _folder;
}
@Override
public void execute() {
- containerPanel.hide();
-// if (app.getCurrentSelection() instanceof FileResource || app.getCurrentSelection() instanceof List)
-// app.showFileList(true);
-// else if (app.getCurrentSelection() instanceof GroupUserResource)
-// return;
-// else{
-// //TODO:CELLTREE
-// //DnDTreeItem selectedTreeItem = (DnDTreeItem) app.getFolders().getCurrent();
-// //if(selectedTreeItem != null){
-// //app.getFolders().updateFolder(selectedTreeItem);
-// app.getTreeView().updateNode(app.getTreeView().getSelection());
-// app.showFileList(true);
-// //}
-// }
+ if (containerPanel != null)
+ containerPanel.hide();
+ app.updateFolder(folder, true, null);
}
}