Workaround to include some images in the css resources instead of loading externally
[pithos-web-client] / src / gr / grnet / pithos / web / client / mysharedtree / MysharedTreeView.java
index bcf24c3..ae4c15e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 GRNET S.A. All rights reserved.
+ * Copyright 2011-2012 GRNET S.A. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or
  * without modification, are permitted provided that the following
@@ -41,7 +41,9 @@ import gr.grnet.pithos.web.client.foldertree.Folder;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.resources.client.ImageResource;
+import com.google.gwt.resources.client.ClientBundle.Source;
 import com.google.gwt.resources.client.ImageResource.ImageOptions;
+import com.google.gwt.resources.client.ImageResource.RepeatStyle;
 import com.google.gwt.safehtml.client.SafeHtmlTemplates;
 import com.google.gwt.safehtml.shared.SafeHtml;
 import com.google.gwt.user.cellview.client.CellTree;
@@ -92,6 +94,10 @@ public class MysharedTreeView extends Composite implements TreeView {
         @Override
                @Source({"gr/grnet/pithos/web/client/PithosCellTreeBasic.css"})
         CellTree.Style cellTreeStyle();
+        
+        @Source("gr/grnet/pithos/web/client/cellTreeLoadingBasic.gif")
+        @ImageOptions(repeatStyle=RepeatStyle.None)
+        ImageResource cellTreeLoadingBasic();
     }
 
     public static interface Images extends Tree.Resources, FolderContextMenu.Images {
@@ -151,6 +157,9 @@ public class MysharedTreeView extends Composite implements TreeView {
     }
 
        public void updateRoot() {
+               TreeNode root = ((CellTree) getWidget()).getRootTreeNode();
+               root.setChildOpen(0, true);
+               root.setChildOpen(0, false);
                model.fetchSharedFiles(false);
        }
 }