this.style.ensureInjected();
initWidget(new SimplePanel());
setStyleName(this.style.cellTreeWidget());
// Initialize the open and close images strings.
ImageResource treeOpen = resources.cellTreeOpenItem();
ImageResource treeClosed = resources.cellTreeClosedItem();
ImageResource treeLoading = resources.cellTreeLoading();
openImageHtml = getImageHtml(treeOpen, false);
closedImageHtml = getImageHtml(treeClosed, false);
openImageTopHtml = getImageHtml(treeOpen, true);
closedImageTopHtml = getImageHtml(treeClosed, true);
loadingImageHtml = getImageHtml(treeLoading, false);
imageWidth = Math.max(Math.max(treeOpen.getWidth(), treeClosed.getWidth()),
treeLoading.getWidth());
// We use one animation for the entire tree.
setAnimation(SlideAnimation.create());
// Add event handlers.