Show a loader until the contents of "Shared with me" are fully loaded
authorChristos KK Loverdos <loverdos@gmail.com>
Fri, 31 May 2013 10:04:08 +0000 (13:04 +0300)
committerChristos KK Loverdos <loverdos@gmail.com>
Fri, 31 May 2013 10:04:08 +0000 (13:04 +0300)
Refs #3784

src/gr/grnet/pithos/web/client/Pithos.java
src/gr/grnet/pithos/web/client/PithosDisclosurePanel.java
src/gr/grnet/pithos/web/client/othersharedtree/OtherSharedTreeView.java

index fc8a544..84079df 100644 (file)
@@ -1356,7 +1356,7 @@ public class Pithos implements EntryPoint, ResizeHandler {
         selectionModels.add(otherSharedTreeSelectionModel);
         otherSharedTreeViewModel = new OtherSharedTreeViewModel(Pithos.this, otherSharedTreeSelectionModel);
         // #3784 We show it empty...
-        otherSharedTreeView = new OtherSharedTreeView(otherSharedTreeViewModel);
+        otherSharedTreeView = new OtherSharedTreeView(otherSharedTreeViewModel, true);
         trees.insert(otherSharedTreeView, 1);
 
         LOG("Pithos::createOtherSharedTree(), initializing otherSharedTreeViewModel with a callback");
@@ -1366,7 +1366,7 @@ public class Pithos implements EntryPoint, ResizeHandler {
                 // #3784 ... then remove the empty stuff and add a new view with the populated model
                 trees.remove(otherSharedTreeView);
 
-                otherSharedTreeView = new OtherSharedTreeView(otherSharedTreeViewModel);
+                otherSharedTreeView = new OtherSharedTreeView(otherSharedTreeViewModel, false);
                 trees.insert(otherSharedTreeView, 1);
                 treeViews.add(otherSharedTreeView);
                 scheduleResfresh();
index 5dd2425..25551e1 100644 (file)
@@ -75,13 +75,24 @@ public class PithosDisclosurePanel extends Composite {
                
                @Source("downArrow.png")
                ImageResource closed();
+
+        @Source("gr/grnet/pithos/resources/ajax-loader.gif")
+        ImageResource ajaxLoader();
        }
        
        DisclosurePanel panel;
        
        Resources resources;
-       
-       public PithosDisclosurePanel(final Resources _resources, final String title, boolean open) {
+
+    final boolean ajaxLoader;
+
+    public PithosDisclosurePanel(final Resources _resources, final String title, boolean open) {
+        this(_resources, title, open, false);
+    }
+
+       public PithosDisclosurePanel(final Resources _resources, final String title, boolean open, boolean ajaxLoader) {
+        this.ajaxLoader = ajaxLoader;
+
                resources = _resources;
                resources.pithosDisclosurePanelCss().ensureInjected();
                panel = new DisclosurePanel();
@@ -111,6 +122,10 @@ public class PithosDisclosurePanel extends Composite {
         
                Image img = new Image(resources.icon());
                header.add(img);
+        if(ajaxLoader) {
+            final Image alImg = new Image(resources.ajaxLoader());
+            header.add(alImg);
+        }
                header.setCellVerticalAlignment(img, HasVerticalAlignment.ALIGN_MIDDLE);
                header.setCellWidth(img, "32px");
                HTML titleHtml = new HTML(title);
index 50ae67a..95643af 100644 (file)
@@ -154,10 +154,10 @@ public class OtherSharedTreeView extends Composite implements TreeView {
 
     private CellTree tree;
     
-    public OtherSharedTreeView(OtherSharedTreeViewModel viewModel) {
+    public OtherSharedTreeView(OtherSharedTreeViewModel viewModel, boolean ajaxLoader) {
         this.model = viewModel;
         
-        PithosDisclosurePanel panel = new PithosDisclosurePanel((Resources) GWT.create(Resources.class), Const.TXT_SHARED_WITH_ME, false);
+        PithosDisclosurePanel panel = new PithosDisclosurePanel((Resources) GWT.create(Resources.class), Const.TXT_SHARED_WITH_ME, false, ajaxLoader);
         /*
          * Create the tree using the model. We use <code>null</code> as the default
          * value of the root node. The default value will be passed to