/*
- * Copyright 2011-2012 GRNET S.A. All rights reserved.
+ * Copyright 2011-2013 GRNET S.A. All rights reserved.
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
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.PithosDisclosurePanel.Style;
import gr.grnet.pithos.web.client.foldertree.Folder;
import com.google.gwt.core.client.GWT;
public class GroupTreeView extends Composite implements TreeView {
public void updateChildren(Group group) {
- TreeNode root = ((CellTree) getWidget()).getRootTreeNode();
+ TreeNode root = tree.getRootTreeNode();
if (group != null)
updateChildren(root, group);
- else {
+ else if (root.getChildCount() > 0) {
root.setChildOpen(0, false, true);
root.setChildOpen(0, true, true);
}
static Images images = GWT.create(Images.class);
- interface Resources extends gr.grnet.pithos.web.client.PithosDisclosurePanel.Resources {
+ interface Style extends gr.grnet.pithos.web.client.PithosDisclosurePanel.Style {
@Override
+ String header();
+ }
+
+ interface Resources extends gr.grnet.pithos.web.client.PithosDisclosurePanel.Resources {
+ @Override
+ @Source("PithosGroupDisclosurePanel.css")
+ Style pithosDisclosurePanelCss();
+
+ @Override
@Source("gr/grnet/pithos/resources/groups22.png")
ImageResource icon();
}
}
private GroupTreeViewModel model;
+
+ private CellTree tree;
public GroupTreeView(GroupTreeViewModel viewModel) {
this.model = viewModel;
* 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);
- panel.add(tree);
+ panel.setContent(tree);
initWidget(panel);
}
@Override
public Folder getSelection() {
- // TODO Auto-generated method stub
return null;
}