Revision f1aabd89 src/gr/grnet/pithos/web/client/commands/DeleteCommand.java
b/src/gr/grnet/pithos/web/client/commands/DeleteCommand.java | ||
---|---|---|
38 | 38 |
import gr.grnet.pithos.web.client.DeleteFolderDialog; |
39 | 39 |
import gr.grnet.pithos.web.client.EditMenu.Images; |
40 | 40 |
import gr.grnet.pithos.web.client.GSS; |
41 |
import gr.grnet.pithos.web.client.foldertree.File; |
|
42 |
import gr.grnet.pithos.web.client.foldertree.Folder; |
|
43 |
import gr.grnet.pithos.web.client.foldertree.Resource; |
|
41 | 44 |
import gr.grnet.pithos.web.client.rest.resource.FileResource; |
42 | 45 |
import gr.grnet.pithos.web.client.rest.resource.GroupUserResource; |
43 | 46 |
import gr.grnet.pithos.web.client.rest.resource.RestResourceWrapper; |
... | ... | |
57 | 60 |
private PopupPanel containerPanel; |
58 | 61 |
final Images newImages; |
59 | 62 |
|
63 |
private Resource resource; |
|
64 |
|
|
60 | 65 |
/** |
61 | 66 |
* @param _containerPanel |
62 | 67 |
* @param _newImages the images of all the possible delete dialogs |
63 | 68 |
*/ |
64 |
public DeleteCommand( PopupPanel _containerPanel, final Images _newImages ){ |
|
69 |
public DeleteCommand( PopupPanel _containerPanel, Resource resource, final Images _newImages ){
|
|
65 | 70 |
containerPanel = _containerPanel; |
66 |
newImages=_newImages; |
|
71 |
newImages = _newImages; |
|
72 |
this.resource = resource; |
|
67 | 73 |
} |
68 | 74 |
|
69 | 75 |
@Override |
... | ... | |
77 | 83 |
* |
78 | 84 |
*/ |
79 | 85 |
void displayDelete() { |
80 |
Object selection = GSS.get().getCurrentSelection(); |
|
81 |
if (selection == null) |
|
82 |
return; |
|
83 |
GWT.log("selection: " + selection.toString(), null); |
|
84 |
if (selection instanceof RestResourceWrapper) { |
|
85 |
DeleteFolderDialog dlg = new DeleteFolderDialog(newImages); |
|
86 |
if (resource instanceof Folder) { |
|
87 |
DeleteFolderDialog dlg = new DeleteFolderDialog(GSS.get(), newImages, (Folder) resource); |
|
86 | 88 |
dlg.center(); |
87 |
} else if (selection instanceof FileResource || selection instanceof List) {
|
|
89 |
} else if (resource instanceof File) {
|
|
88 | 90 |
DeleteFileDialog dlg = new DeleteFileDialog(newImages); |
89 | 91 |
dlg.center(); |
90 |
} else if (selection instanceof GroupUserResource) { |
|
91 |
// TODO implement user deletion |
|
92 | 92 |
} |
93 | 93 |
} |
94 | 94 |
} |
Also available in: Unified diff