Hello,
The cell tree get all it resources (images and css) from
CellTree.BasicResources which extends CellTree.Resources.
To use your own images and css you have to extend CellTree.Resources.
Ex:
interface TreeResources extends CellTree.Resources {
@Source("cellTreeClosedItem.gif")
ImageResource cellTreeClosedItem();
@Source("cellTreeOpenItem.gif")
ImageResource cellTreeOpenItem();
@Source("MyCellTree.css")
CellTree.Style cellTreeStyle();
}
This tells that the cellTreeCloseItem image will be
'cellTreeClosedItem.gif' which is in the same package as your custom
interface TreeResources. You can put the image in another package if
you want. You just have to prefix the image name with the the package
path.
It also tells that the cellTreeOpenItem image will be
'cellTreeOpenItem.gif' and that the css to use for the tree style will
be "MyCellTree.css".
To create MyCellTree.css, just copy the content from CellTree.css
which is in the package com\google\gwt\user\cellview\client (from gwt-
user.jar or
http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/user/cellview/client/CellTree.css)
and customize it.
Then to tell your tree to use your customized resource you just do :
CellTree.Resources resource = GWT.create(TreeResources.class);
CellTree cellTree = new CellTree(new MyTreeModel(),null, resource);
I know it is a bit weird and badly documented from Google :/
I've spent hours to find how to do this.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.