Revision 2390ae8e
b/src/gr/ebs/gss/client/FolderContextMenu.java | ||
---|---|---|
29 | 29 |
import gr.ebs.gss.client.commands.RestoreTrashCommand; |
30 | 30 |
import gr.ebs.gss.client.commands.ToTrashCommand; |
31 | 31 |
import gr.ebs.gss.client.commands.UploadFileCommand; |
32 |
import gr.ebs.gss.client.rest.resource.FolderResource; |
|
32 | 33 |
import gr.ebs.gss.client.rest.resource.MyFolderResource; |
33 | 34 |
import gr.ebs.gss.client.rest.resource.OtherUserResource; |
34 | 35 |
import gr.ebs.gss.client.rest.resource.OthersFolderResource; |
... | ... | |
79 | 80 |
pasteItem = new MenuItem("<span id = 'folderContextMenu.paste'>" + AbstractImagePrototype.create(newImages.paste()).getHTML() + " Paste</span>", true, new PasteCommand(this)); |
80 | 81 |
MenuBar contextMenu = new MenuBar(true); |
81 | 82 |
|
82 |
|
|
83 |
|
|
84 | 83 |
RestResource selectedItem = GSS.get().getTreeView().getSelection(); |
85 | 84 |
|
86 |
|
|
87 | 85 |
if(selectedItem != null) |
88 |
if(selectedItem instanceof MyFolderResource){ |
|
86 |
if(selectedItem instanceof MyFolderResource){
|
|
89 | 87 |
MenuItem newFolder = new MenuItem("<span id = 'folderContextMenu.newFolder'>" + AbstractImagePrototype.create(newImages.folderNew()).getHTML() + " New Folder</span>", true, new NewFolderCommand(this, images)); |
90 | 88 |
contextMenu.addItem(newFolder); |
91 | 89 |
|
92 | 90 |
MenuItem upload = new MenuItem("<span id = 'folderContextMenu.upload'>" + AbstractImagePrototype.create(newImages.fileUpdate()).getHTML() + " Upload</span>", true, new UploadFileCommand(this)); |
93 | 91 |
contextMenu.addItem(upload); |
94 |
|
|
95 |
boolean notRootFolder = !GSS.get().getTreeView().getMyFolders().equals(selectedItem);
|
|
92 |
|
|
93 |
boolean notRootFolder =(((MyFolderResource) selectedItem).getResource()).getParentURI() != null ? true : false;
|
|
96 | 94 |
if (notRootFolder) { |
97 | 95 |
// do not show the copy & cut option for the user's root folder |
98 | 96 |
MenuItem cut = new MenuItem("<span id = 'folderContextMenu.cut'>" + AbstractImagePrototype.create(newImages.cut()).getHTML() + " Cut</span>", true, new CutCommand(this)); |
99 | 97 |
contextMenu.addItem(cut); |
100 | 98 |
|
101 |
MenuItem copy = new MenuItem("<span id = 'folderContextMenu.copy'>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + " Copy</span>", true, new CopyCommand(this)); |
|
102 |
contextMenu.addItem(copy); |
|
103 |
|
|
104 | 99 |
} |
100 |
MenuItem copy = new MenuItem("<span id = 'folderContextMenu.copy'>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + " Copy</span>", true, new CopyCommand(this)); |
|
101 |
contextMenu.addItem(copy); |
|
105 | 102 |
contextMenu.addItem(pasteItem); |
106 | 103 |
if (notRootFolder) { |
107 | 104 |
// do not show delete options for the user's root folder |
Also available in: Unified diff