DnDFolderPopupMenu popup ;
if(context.getDraggableData() instanceof FileResource){
- popup = new DnDFolderPopupMenu(images, ((MyFolderResource) context.getDroppableData()).getResource(), Arrays.asList(context.getDraggableData()));
+ if(context.getDroppableData() instanceof RestResourceWrapper)
+ popup = new DnDFolderPopupMenu(images, ((RestResourceWrapper) context.getDroppableData()).getResource(), Arrays.asList(context.getDraggableData()));
+ else
+ popup = new DnDFolderPopupMenu(images, null, Arrays.asList(context.getDraggableData()));
}
- else
- popup = new DnDFolderPopupMenu(images, ((MyFolderResource) context.getDroppableData()).getResource(), context.getDraggableData());
+
+ else{
+ if(context.getDroppableData() instanceof RestResourceWrapper)
+ popup = new DnDFolderPopupMenu(images, ((RestResourceWrapper) context.getDroppableData()).getResource(), context.getDraggableData());
+ else
+ popup = new DnDFolderPopupMenu(images, null, context.getDraggableData());
+ }
+
int left = context.getDroppable().getAbsoluteLeft() + 40;
int top = context.getDroppable().getAbsoluteTop() + 20;
popup.setPopupPosition(left, top);
getRootNodes().getList().set(getRootNodes().getList().indexOf(r),GSS.get().getTreeView().getTrash());
}
GSS.get().getTreeView().updateNodeChildren(GSS.get().getTreeView().getTrash());
- GSS.get().showFileList(true);
+ //GSS.get().showFileList(true);
+ GSS.get().onResourceUpdate(value);
}
@Override
};
DeferredCommand.addCommand(gf);
}
+ else if(value instanceof SharedFolderResource){
+ GetCommand<FolderResource> gf = new GetCommand<FolderResource>(FolderResource.class, value.getUri(), null) {
+
+ @Override
+ public void onComplete() {
+ FolderResource rootResource = getResult();
+ //((MyFolderResource)value).getResource().setFiles(rootResource.getFiles());
+ ((SharedFolderResource)value).setResource(rootResource);
+ if(GSS.get().getTreeView().getSelection().getUri().equals(value.getUri()))
+ selectionModel.setSelected(value, true);
+ GSS.get().onResourceUpdate(value);
+
+ }
+
+ @Override
+ public void onError(Throwable t) {
+ GWT.log("Error fetching root folder", t);
+ GSS.get().displayError("Unable to fetch root folder");
+ }
+
+ };
+ DeferredCommand.addCommand(gf);
+ }
+ else if(value instanceof SharedResource){
+ GetCommand<SharedResource> gf = new GetCommand<SharedResource>(SharedResource.class, value.getUri(), null) {
+
+ @Override
+ public void onComplete() {
+ SharedResource rootResource = getResult();
+ ((SharedResource)value).setFolders(getResult().getFolders());
+ ((SharedResource)value).setFiles(getResult().getFiles());
+
+ if(GSS.get().getTreeView().getSelection().getUri().equals(value.getUri()))
+ selectionModel.setSelected(value, true);
+ GSS.get().onResourceUpdate(value);
+
+ }
+
+ @Override
+ public void onError(Throwable t) {
+ GWT.log("Error fetching root folder", t);
+ GSS.get().displayError("Unable to fetch root folder");
+ }
+
+ };
+ DeferredCommand.addCommand(gf);
+ }
+ else if(value instanceof OtherUserResource){
+ GetCommand<OtherUserResource> gf = new GetCommand<OtherUserResource>(OtherUserResource.class, value.getUri(), null) {
+
+ @Override
+ public void onComplete() {
+ OtherUserResource rootResource = getResult();
+ ((OtherUserResource)value).setFolders(getResult().getFolders());
+ ((OtherUserResource)value).setFiles(getResult().getFiles());
+
+ if(GSS.get().getTreeView().getSelection().getUri().equals(value.getUri()))
+ selectionModel.setSelected(value, true);
+ GSS.get().onResourceUpdate(value);
+
+ }
+
+ @Override
+ public void onError(Throwable t) {
+ GWT.log("Error fetching root folder", t);
+ GSS.get().displayError("Unable to fetch root folder");
+ }
+
+ };
+ DeferredCommand.addCommand(gf);
+ }
}