Emily -

Can you review the attached patch that has two Tree fixes for the 1.5
branch?

Please verify that this patch captures both of the fixes in, which have
already been committed to trunk:
http://code.google.com/p/google-web-toolkit/issues/detail?id=2853
http://code.google.com/p/google-web-toolkit/issues/detail?id=2491

Thanks,
John LaBanca
[EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Index: user/src/com/google/gwt/user/client/ui/TreeItem.java
===================================================================
--- user/src/com/google/gwt/user/client/ui/TreeItem.java	(revision 3728)
+++ user/src/com/google/gwt/user/client/ui/TreeItem.java	(working copy)
@@ -107,11 +107,6 @@
     void initializeClonableElements() {
       super.initializeClonableElements();
       if (GWT.isClient()) {
-        // Remove the padding from the cells and re-add it to the table element
-        DOM.setElementPropertyInt(BASE_INTERNAL_ELEM, "cellPadding", 0);
-        DOM.setElementPropertyInt(BASE_INTERNAL_ELEM, "cellSpacing", 0);
-        BASE_INTERNAL_ELEM.getStyle().setPropertyPx("paddingBottom", 3);
-
         // We can't use a 3px padding all around because IE will wrap the
         // childSpan to the next line, so we need to add a 3px margin on the top
         // and bottom instead. However, margins overlap, so we need a 6px bottom
@@ -688,7 +683,7 @@
   }
 
   Element getImageHolderElement() {
-    if (imageHolder == null) {
+    if (!isFullNode()) {
       convertToFullNode();
     }
     return imageHolder;
@@ -702,6 +697,10 @@
     children = new ArrayList<TreeItem>();
   }
 
+  boolean isFullNode() {
+    return imageHolder != null;
+  }
+
   void setParentItem(TreeItem parent) {
     this.parent = parent;
   }
Index: user/src/com/google/gwt/user/client/ui/Tree.java
===================================================================
--- user/src/com/google/gwt/user/client/ui/Tree.java	(revision 3728)
+++ user/src/com/google/gwt/user/client/ui/Tree.java	(working copy)
@@ -777,7 +777,7 @@
    * @param treeItem the tree item
    */
   void showLeafImage(TreeItem treeItem) {
-    if (useLeafImages) {
+    if (useLeafImages || treeItem.isFullNode()) {
       showImage(treeItem, images.treeLeaf());
     } else {
       DOM.setStyleAttribute(treeItem.getElement(), "paddingLeft", indentValue);

Reply via email to