Automated merge with https://gss.googlecode.com/hg/
authorNatasa Kapravelou <akapravelou@gmail.com>
Tue, 1 Jun 2010 15:27:00 +0000 (18:27 +0300)
committerNatasa Kapravelou <akapravelou@gmail.com>
Tue, 1 Jun 2010 15:27:00 +0000 (18:27 +0300)
1  2 
src/gr/ebs/gss/client/PopupTree.java

@@@ -66,10 -68,61 +66,10 @@@ public class PopupTree extends Tree 
                        @Override
                        public void onSelection(SelectionEvent<TreeItem> event) {
                                TreeItem item = event.getSelectedItem();
-                               processItemSelected(item, true);
+                               processItemSelected(item);
                                String path = GSS.get().getApiPath() + GSS.get().getCurrentUserResource().getUsername()+ "/";
 -//                            case: Trash folder is selected
 -                              if(GSS.get().getFolders().getCurrent().getUserObject() instanceof TrashResource){
 -                                      TrashResource currentObject = (TrashResource) GSS.get().getFolders().getCurrent().getUserObject();
 -                                      GSS.get().updateHistory("Files/"+ currentObject.getUri().substring(path.lastIndexOf("/")+1), item);
 +                              ((RestResource) GSS.get().getFolders().getCurrent().getUserObject()).updateHistoryAbs(item,path);
                                }
 -//                            case: Other's shared folder option is selected
 -                              else if (GSS.get().getFolders().getCurrent().getUserObject() instanceof OthersResource)
 -                                      GSS.get().updateHistory("Files/"+ path.substring(path.lastIndexOf("/")+1) + "others/", item);
 -                              else if(GSS.get().getFolders().getCurrent().getUserObject() instanceof OtherUserResource){
 -                                      OtherUserResource currentObject = (OtherUserResource) GSS.get().getFolders().getCurrent().getUserObject();
 -                                      GSS.get().updateHistory("Files/others/"+ currentObject.getName(), item);
 -                                      }
 -//                            case: my shared is selected
 -                              else if(GSS.get().getFolders().getCurrent().getUserObject() instanceof SharedResource){
 -                                      SharedResource currentObject = (SharedResource) GSS.get().getFolders().getCurrent().getUserObject();
 -                                      GSS.get().updateHistory("Files/"+ currentObject.getUri().substring(path.lastIndexOf("/")+1), item);
 -                              }
 -                              else{
 -//                                    case: all folder resources either below user's home folder or anywhere else(Trash/My Shared/Other's shared
 -                                      FolderResource currentObject = (FolderResource) GSS.get().getFolders().getCurrent().getUserObject();
 -                                      String parentUri = currentObject.getParentURI();
 -                                      if(parentUri == null){
 -                                              if(containsFolder(item, "Trash")){
 -//                                                    case: selected folders below Trash folder
 -                                                      String partialUri = constructPartialPath(item);
 -                                                      GSS.get().updateHistory("Files/trash/" + partialUri, item);
 -                                              } else
 -//                                                    case: home folders are selected
 -                                                      GSS.get().updateHistory("Files/files/" + currentObject.getName(), item);
 -                                      }
 -                                      else if(item.getParentItem() == null){
 -//                                            this is the case when the user uses the browser's forward arrow to navigate through other's
 -//                                            shared folders and      item.getParentItem is null only inside other's shared folder
 -                                              String apiPath = GSS.get().getApiPath();
 -                                              String newPath = currentObject.getParentURI().substring(apiPath.lastIndexOf("/"));
 -                                              GSS.get().updateHistory("Files"+ newPath + currentObject.getName(), item);
 -                                      }
 -                                      else if(containsFolder(item, "My Shared")){
 -//                                            case: selected folders below My Shared folder
 -                                              String partialUri = constructPartialPath(item);
 -                                              GSS.get().updateHistory("Files/shared/" + partialUri, item);
 -                                      }else if(containsFolder(item, "Other's Shared")){
 -//                                            case: selected folders below Other's Shared folder
 -                                              String partialPath = constructPartialPath(item);
 -                                              GSS.get().updateHistory("Files/others/"+ partialPath, item);
 -                                      }
 -                                      else{
 -//                                            case:all folders in user's folders tree
 -                                              String finalUri = parentUri.substring(path.lastIndexOf("/")) + currentObject.getName();
 -                                              GSS.get().updateHistory("Files"+ finalUri, item);
 -                                      }
 -                              }
 -                      }
                });
  
                addOpenHandler(new OpenHandler<TreeItem>() {