Various CSS and cosmetic fixes
[pithos-web-client] / src / gr / grnet / pithos / web / client / othersharedtree / OtherSharedTreeView.java
index 739ce18..b003bec 100644 (file)
 package gr.grnet.pithos.web.client.othersharedtree;
 
 import gr.grnet.pithos.web.client.FolderContextMenu;
+import gr.grnet.pithos.web.client.PithosDisclosurePanel;
 import gr.grnet.pithos.web.client.TreeView;
 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;
@@ -55,7 +55,7 @@ import com.google.gwt.user.client.ui.Tree;
 public class OtherSharedTreeView extends Composite implements TreeView {
 
     public void updateChildren(Folder folder) {
-        TreeNode root = ((CellTree) getWidget()).getRootTreeNode();
+        TreeNode root = tree.getRootTreeNode();
         updateChildren(root, folder);
     }
 
@@ -105,13 +105,13 @@ public class OtherSharedTreeView extends Composite implements TreeView {
         @Source("gr/grnet/pithos/resources/home22.png")
         ImageResource home();
 
-        @Source("gr/grnet/pithos/resources/folder22.png")
+        @Source("gr/grnet/pithos/resources/2folder22.png")
         public ImageResource folderYellow();
 
         @Source("gr/grnet/pithos/resources/mimetypes/document.png")
         ImageResource document();
 
-        @Source("gr/grnet/pithos/resources/othersshared.png")
+        @Source("gr/grnet/pithos/resources/sharedtome22.png")
         ImageResource othersShared();
 
         @Source("gr/grnet/pithos/resources/myshared22.png")
@@ -133,20 +133,40 @@ public class OtherSharedTreeView extends Composite implements TreeView {
         public SafeHtml nameSpan(String name);
       }
 
+    interface Style extends gr.grnet.pithos.web.client.PithosDisclosurePanel.Style {
+       @Override
+               String disclosurePanel();
+    }
+
+    interface Resources extends gr.grnet.pithos.web.client.PithosDisclosurePanel.Resources {
+               @Override
+               @Source("PithosOtherSharedDisclosurePanel.css")
+               Style pithosDisclosurePanelCss();
+
+               @Override
+               @Source("gr/grnet/pithos/resources/sharedtome22.png")
+       ImageResource icon();
+    }
+
     private OtherSharedTreeViewModel model;
 
+    private CellTree tree;
+    
     public OtherSharedTreeView(OtherSharedTreeViewModel viewModel) {
         this.model = viewModel;
+        
+        PithosDisclosurePanel panel = new PithosDisclosurePanel((Resources) GWT.create(Resources.class), "Shared to me", false); 
         /*
          * 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
          * CustomTreeModel#getNodeInfo();
          */
         CellTree.Resources res = GWT.create(BasicResources.class);
-        CellTree tree = new CellTree(model, null, res);
+        tree = new CellTree(model, null, res);
         tree.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);
 
-        initWidget(tree);
+        panel.setContent(tree);
+        initWidget(panel);
     }