X-Git-Url: https://code.grnet.gr/git/pithos/blobdiff_plain/e2d2e378fc586ece131bd47efc68707b3653d864..5b09ea6c7d2b6fcb2cd27c6b8d664f0a962d9b51:/src/gr/ebs/gss/client/FolderContextMenu.java
diff --git a/src/gr/ebs/gss/client/FolderContextMenu.java b/src/gr/ebs/gss/client/FolderContextMenu.java
index 5ff2ab4..cc376e6 100644
--- a/src/gr/ebs/gss/client/FolderContextMenu.java
+++ b/src/gr/ebs/gss/client/FolderContextMenu.java
@@ -31,6 +31,8 @@ import gr.ebs.gss.client.commands.ToTrashCommand;
import gr.ebs.gss.client.commands.UploadFileCommand;
import gr.ebs.gss.client.rest.resource.OtherUserResource;
+import com.google.gwt.resources.client.ClientBundle;
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.MenuBar;
import com.google.gwt.user.client.ui.MenuItem;
import com.google.gwt.user.client.ui.PopupPanel;
@@ -50,7 +52,7 @@ public class FolderContextMenu extends PopupPanel {
* The image bundle for this widget's images that reuses images defined in
* other menus.
*/
- public interface Images extends FileMenu.Images, EditMenu.Images {
+ public interface Images extends ClientBundle,FileMenu.Images, EditMenu.Images {
}
private MenuItem pasteItem;
@@ -67,8 +69,10 @@ public class FolderContextMenu extends PopupPanel {
setAnimationEnabled(true);
images = newImages;
- pasteItem = new MenuItem("" + newImages.paste().getHTML() + " Paste", true, new PasteCommand(this));
+ pasteItem = new MenuItem("" + AbstractImagePrototype.create(newImages.paste()).getHTML() + " Paste", true, new PasteCommand(this));
MenuBar contextMenu = new MenuBar(true);
+ //TODO:CELLTREE
+ /*
Folders folders = GSS.get().getFolders();
TreeItem selectedItem = folders.getCurrent();
@@ -76,59 +80,60 @@ public class FolderContextMenu extends PopupPanel {
if(selectedItem != null)
if(folders.isTrashItem(selectedItem)){
if (folders.isTrash(selectedItem)){
- contextMenu.addItem("" + newImages.delete().getHTML() + " Empty Trash", true, new EmptyTrashCommand(this));
- contextMenu.addItem("" + images.refresh().getHTML() + " Refresh", true, new RefreshCommand(this, images));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.delete()).getHTML() + " Empty Trash", true, new EmptyTrashCommand(this));
+ contextMenu.addItem("" + AbstractImagePrototype.create(images.refresh()).getHTML() + " Refresh", true, new RefreshCommand(this, images));
}
else {
- contextMenu.addItem("" + newImages.viewText().getHTML() + " Restore folder and contents", true, new RestoreTrashCommand(this));
- contextMenu.addItem("" + newImages.delete().getHTML() + " Delete", true, new DeleteCommand(this, newImages));
- contextMenu.addItem("" + images.refresh().getHTML() + " Refresh", true, new RefreshCommand(this, images));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + " Restore folder and contents", true, new RestoreTrashCommand(this));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.delete()).getHTML() + " Delete", true, new DeleteCommand(this, newImages));
+ contextMenu.addItem("" + AbstractImagePrototype.create(images.refresh()).getHTML() + " Refresh", true, new RefreshCommand(this, images));
}
}
else if(folders.isFileItem(selectedItem)){
- contextMenu.addItem("" + newImages.folderNew().getHTML() + " New Folder", true, new NewFolderCommand(this, images));
- contextMenu.addItem("" + newImages.fileUpdate().getHTML() + " Upload", true, new UploadFileCommand(this));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.folderNew()).getHTML() + " New Folder", true, new NewFolderCommand(this, images));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.fileUpdate()).getHTML() + " Upload", true, new UploadFileCommand(this));
boolean notRootFolder = !folders.getRootItem().equals(selectedItem);
if (notRootFolder) {
// do not show the copy & cut option for the user's root folder
- contextMenu.addItem("" + newImages.cut().getHTML() + " Cut", true, new CutCommand(this));
- contextMenu.addItem("" + newImages.copy().getHTML() + " Copy", true, new CopyCommand(this));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.cut()).getHTML() + " Cut", true, new CutCommand(this));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.copy()).getHTML() + " Copy", true, new CopyCommand(this));
}
contextMenu.addItem(pasteItem);
if (notRootFolder) {
// do not show delete options for the user's root folder
- contextMenu.addItem("" + newImages.emptyTrash().getHTML() + " Move to Trash", true, new ToTrashCommand(this));
- contextMenu.addItem("" + newImages.delete().getHTML() + " Delete", true, new DeleteCommand(this, newImages));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.emptyTrash()).getHTML() + " Move to Trash", true, new ToTrashCommand(this));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.delete()).getHTML() + " Delete", true, new DeleteCommand(this, newImages));
}
- contextMenu.addItem("" + images.refresh().getHTML() + " Refresh", true, new RefreshCommand(this, images));
- contextMenu.addItem("" + newImages.sharing().getHTML() + " Sharing", true, new PropertiesCommand(this, newImages, 1));
- contextMenu.addItem("" + newImages.viewText().getHTML() + " Properties", true, new PropertiesCommand(this, newImages, 0));
+ contextMenu.addItem("" + AbstractImagePrototype.create(images.refresh()).getHTML() + " Refresh", true, new RefreshCommand(this, images));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.sharing()).getHTML() + " Sharing", true, new PropertiesCommand(this, newImages, 1));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + " Properties", true, new PropertiesCommand(this, newImages, 0));
}
else if(!folders.isMyShares(selectedItem) && folders.isMySharedItem(selectedItem)){
- contextMenu.addItem("" + newImages.folderNew().getHTML() + " New Folder", true, new NewFolderCommand(this, images));
- contextMenu.addItem("" + newImages.fileUpdate().getHTML() + " Upload", true, new UploadFileCommand(this));
- contextMenu.addItem("" + newImages.cut().getHTML() + " Cut", true, new CutCommand(this));
- contextMenu.addItem("" + newImages.copy().getHTML() + " Copy", true, new CopyCommand(this));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.folderNew()).getHTML() + " New Folder", true, new NewFolderCommand(this, images));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.fileUpdate()).getHTML() + " Upload", true, new UploadFileCommand(this));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.cut()).getHTML() + " Cut", true, new CutCommand(this));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.copy()).getHTML() + " Copy", true, new CopyCommand(this));
contextMenu.addItem(pasteItem);
- contextMenu.addItem("" + newImages.emptyTrash().getHTML() + " Move to Trash", true, new ToTrashCommand(this));
- contextMenu.addItem("" + newImages.delete().getHTML() + " Delete", true, new DeleteCommand(this, newImages));
- contextMenu.addItem("" + images.refresh().getHTML() + " Refresh", true, new RefreshCommand(this, images));
- contextMenu.addItem("" + newImages.sharing().getHTML() + " Sharing", true, new PropertiesCommand(this, newImages, 1));
- contextMenu.addItem("" + newImages.viewText().getHTML() + " Properties", true, new PropertiesCommand(this, newImages, 0));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.emptyTrash()).getHTML() + " Move to Trash", true, new ToTrashCommand(this));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.delete()).getHTML() + " Delete", true, new DeleteCommand(this, newImages));
+ contextMenu.addItem("" + AbstractImagePrototype.create(images.refresh()).getHTML() + " Refresh", true, new RefreshCommand(this, images));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.sharing()).getHTML() + " Sharing", true, new PropertiesCommand(this, newImages, 1));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + " Properties", true, new PropertiesCommand(this, newImages, 0));
}
else if(!folders.isOthersShared(selectedItem) && folders.isOthersSharedItem(selectedItem) && !(GSS.get().getCurrentSelection() instanceof OtherUserResource)){
- contextMenu.addItem("" + newImages.folderNew().getHTML() + " New Folder", true, new NewFolderCommand(this, images));
- contextMenu.addItem("" + newImages.fileUpdate().getHTML() + " Upload", true, new UploadFileCommand(this));
- contextMenu.addItem("" + newImages.cut().getHTML() + " Cut", true, new CutCommand(this));
- contextMenu.addItem("" + newImages.copy().getHTML() + " Copy", true, new CopyCommand(this));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.folderNew()).getHTML() + " New Folder", true, new NewFolderCommand(this, images));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.fileUpdate()).getHTML() + " Upload", true, new UploadFileCommand(this));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.cut()).getHTML() + " Cut", true, new CutCommand(this));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.copy()).getHTML() + " Copy", true, new CopyCommand(this));
contextMenu.addItem(pasteItem);
- contextMenu.addItem("" + newImages.emptyTrash().getHTML() + " Move to Trash", true, new ToTrashCommand(this));
- contextMenu.addItem("" + newImages.delete().getHTML() + " Delete", true, new DeleteCommand(this, newImages));
- contextMenu.addItem("" + images.refresh().getHTML() + " Refresh", true, new RefreshCommand(this, images));
- contextMenu.addItem("" + newImages.sharing().getHTML() + " Sharing", true, new PropertiesCommand(this, newImages, 1));
- contextMenu.addItem("" + newImages.viewText().getHTML() + " Properties", true, new PropertiesCommand(this, newImages, 0));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.emptyTrash()).getHTML() + " Move to Trash", true, new ToTrashCommand(this));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.delete()).getHTML() + " Delete", true, new DeleteCommand(this, newImages));
+ contextMenu.addItem("" + AbstractImagePrototype.create(images.refresh()).getHTML() + " Refresh", true, new RefreshCommand(this, images));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.sharing()).getHTML() + " Sharing", true, new PropertiesCommand(this, newImages, 1));
+ contextMenu.addItem("" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + " Properties", true, new PropertiesCommand(this, newImages, 0));
} else if(!selectedItem.equals(folders.getSharesItem()))
- contextMenu.addItem("" + images.refresh().getHTML() + " Refresh", true, new RefreshCommand(this, images));
+ contextMenu.addItem("" + AbstractImagePrototype.create(images.refresh()).getHTML() + " Refresh", true, new RefreshCommand(this, images));
+ */
add(contextMenu);
if (GSS.get().getClipboard().hasFolderOrFileItem())
pasteItem.setVisible(true);