Program: 143791
Project: 143791
Buggy source:
private static void createCellBasedView(AbstractBase obj,Form form,StringBuffer html,TextualCSS css,boolean addHeaders,int startY,int endY,Color bgColor,IServiceProvider sp) throws RepositoryException {
  try {
    html.append('\n');
    boolean sortable=true;
    boolean shouldFillAllHorizSpace=false;
    if (obj instanceof ISupportScrollbars) {
      int scrollbars=((ISupportScrollbars)obj).getScrollbars();
      if ((scrollbars & ISupportScrollbars.HORIZONTAL_SCROLLBAR_NEVER) == ISupportScrollbars.HORIZONTAL_SCROLLBAR_NEVER) {
        boolean hasAtLeastOneAnchored=false;
        Iterator<IPersist> it2=obj.getAllObjects(PositionComparator.XY_PERSIST_COMPARATOR);
        while (it2.hasNext()) {
          IPersist element=it2.next();
          if (element instanceof Field || element instanceof GraphicalComponent || element instanceof Bean) {
            if (element instanceof GraphicalComponent && ((GraphicalComponent)element).getLabelFor() != null) {
              continue;
            }
            Point l=((IFormElement)element).getLocation();
            if (l == null) {
              continue;
            }
            if (l.y >= startY && l.y < endY) {
              if (element instanceof ISupportAnchors) {
                int anchors=((ISupportAnchors)element).getAnchors();
                if (((anchors & IAnchorConstants.EAST) != 0) && ((anchors & IAnchorConstants.WEST) != 0)) {
                  hasAtLeastOneAnchored=true;
                  break;
                }
              }
            }
          }
        }
        if (hasAtLeastOneAnchored)         shouldFillAllHorizSpace=true;
      }
    }
    if (obj instanceof Form) {
      html.append("String_Node_Str");
    }
 else {
      Portal p=(Portal)obj;
      sortable=p.getSortable();
      TextualStyle styleObj=css.addStyle('#' + ComponentFactory.getWebID(form,p));
      BorderAndPadding ins=applyBaseComponentProperties(p,form,styleObj,null,null,sp);
      applyLocationAndSize(p,styleObj,ins,startY,endY,form.getSize().width,true);
      html.append("String_Node_Str");
      html.append(getWicketIDParameter(form,p));
      html.append(getCSSClassParameter("String_Node_Str"));
      html.append("String_Node_Str");
    }
    css.addCSSBoundsHandler(NoLocationCSSBoundsHandler.INSTANCE);
    html.append("String_Node_Str");
    int totalWidth=0;
    if (addHeaders) {
      Map<String,GraphicalComponent> labelsFor=new HashMap<String,GraphicalComponent>();
      html.append("String_Node_Str");
      html.append("String_Node_Str");
      html.append("String_Node_Str");
      Iterator<IPersist> it1=obj.getAllObjects(PositionComparator.XY_PERSIST_COMPARATOR);
      while (it1.hasNext()) {
        IPersist element=it1.next();
        if (element instanceof GraphicalComponent && ((GraphicalComponent)element).getLabelFor() != null) {
          labelsFor.put(((GraphicalComponent)element).getLabelFor(),(GraphicalComponent)element);
        }
      }
      boolean usesImageMedia=false;
      boolean hasAtLeastOneLabelFor=false;
      int totalColumnsCount=0;
      Iterator<IPersist> it2=obj.getAllObjects(PositionComparator.XY_PERSIST_COMPARATOR);
      while (it2.hasNext()) {
        IPersist element=it2.next();
        if (element instanceof Field || element instanceof GraphicalComponent || element instanceof Bean) {
          if (element instanceof GraphicalComponent && ((GraphicalComponent)element).getLabelFor() != null) {
            continue;
          }
          Point l=((IFormElement)element).getLocation();
          if (l == null) {
            continue;
          }
          if (l.y >= startY && l.y < endY) {
            totalColumnsCount++;
            GraphicalComponent label=labelsFor.get(((IFormElement)element).getName());
            if (label != null)             hasAtLeastOneLabelFor=true;
          }
        }
      }
      int currentColumnCount=0;
      it2=obj.getAllObjects(PositionComparator.XY_PERSIST_COMPARATOR);
      while (it2.hasNext()) {
        IPersist element=it2.next();
        if (element instanceof Field || element instanceof GraphicalComponent || element instanceof Bean) {
          if (element instanceof GraphicalComponent && ((GraphicalComponent)element).getLabelFor() != null) {
            continue;
          }
          Point l=((IFormElement)element).getLocation();
          if (l == null) {
            continue;
          }
          if (l.y >= startY && l.y < endY) {
            currentColumnCount++;
            html.append("String_Node_Str");
            html.append(getWicketIDParameter(form,element));
            int w=((IFormElement)element).getSize().width;
            totalWidth+=w;
            w=w - 2;
            TextualStyle styleObj=new TextualStyle();
            GraphicalComponent label=labelsFor.get(((IFormElement)element).getName());
            if (label != null) {
              html.append(' ');
              BorderAndPadding ins=applyBaseComponentProperties(label,form,styleObj,(Insets)DEFAULT_LABEL_PADDING.clone(),null,sp);
              Pair<FixedStyleSheet,javax.swing.text.Style> styleInfo=ComponentFactory.getStyleForBasicComponent(sp,label,form);
              Border cssBorder=null;
              if (styleInfo != null) {
                javax.swing.text.Style s=styleInfo.getRight();
                FixedStyleSheet ss=styleInfo.getLeft();
                if (ss != null && s != null) {
                  addAttributeToStyle(styleObj,CSS.Attribute.COLOR.toString(),s.getAttribute(CSS.Attribute.COLOR));
                  addAttributeToStyle(styleObj,CSS.Attribute.BACKGROUND_COLOR.toString(),s.getAttribute(CSS.Attribute.BACKGROUND_COLOR));
                  addAttributeToStyle(styleObj,CSS.Attribute.FONT.toString(),s.getAttribute(CSS.Attribute.FONT));
                  addAttributeToStyle(styleObj,CSS.Attribute.FONT_FAMILY.toString(),s.getAttribute(CSS.Attribute.FONT_FAMILY));
                  addAttributeToStyle(styleObj,CSS.Attribute.FONT_SIZE.toString(),s.getAttribute(CSS.Attribute.FONT_SIZE));
                  addAttributeToStyle(styleObj,CSS.Attribute.FONT_STYLE.toString(),s.getAttribute(CSS.Attribute.FONT_STYLE));
                  addAttributeToStyle(styleObj,CSS.Attribute.FONT_VARIANT.toString(),s.getAttribute(CSS.Attribute.FONT_VARIANT));
                  addAttributeToStyle(styleObj,CSS.Attribute.FONT_WEIGHT.toString(),s.getAttribute(CSS.Attribute.FONT_WEIGHT));
                  cssBorder=ss.getBorder(s);
                }
              }
              if (ins.border != null)               w=w - ins.border.left - ins.border.right;
              applyTextProperties(label,styleObj);
              TextualStyle bgborderstyleObj=new TextualStyle();
              if (!sortable) {
                bgborderstyleObj.setProperty("String_Node_Str",styleObj.getProperty("String_Node_Str"));
                bgborderstyleObj.setProperty("String_Node_Str",styleObj.getProperty("String_Node_Str"));
              }
              if (label.getImageMediaID() <= 0) {
                bgborderstyleObj.setProperty("String_Node_Str","String_Node_Str");
                usesImageMedia=false;
              }
 else {
                usesImageMedia=true;
              }
              bgborderstyleObj.setProperty("String_Node_Str",styleObj.getProperty("String_Node_Str"));
              if (styleObj.getProperty(CSS.Attribute.FONT_WEIGHT.toString()) == null) {
                bgborderstyleObj.setProperty(CSS.Attribute.FONT_WEIGHT.toString(),"String_Node_Str",false);
              }
              if (cssBorder != null && label.getBorderType() == null)               ComponentFactoryHelper.createBorderCSSProperties(ComponentFactoryHelper.createBorderString(cssBorder),bgborderstyleObj);
 else               ComponentFactoryHelper.createBorderCSSProperties(label.getBorderType(),bgborderstyleObj);
              bgborderstyleObj.setProperty(CSS.Attribute.HEIGHT.toString(),label.getSize().height + "String_Node_Str");
              html.append(bgborderstyleObj.toString());
              Enumeration<Object> e=bgborderstyleObj.keys();
              while (e.hasMoreElements()) {
                String key=(String)e.nextElement();
                styleObj.remove(key);
              }
            }
 else {
              if (!hasAtLeastOneLabelFor) {
                TextualStyle defaultBorder=new TextualStyle();
                defaultBorder.setProperty("String_Node_Str",NO_LABELFOR_DEFAULT_BORDER_WIDTH + "String_Node_Str");
                html.append(defaultBorder.toString());
              }
            }
            if (sortable && !usesImageMedia) {
              html.append("String_Node_Str");
            }
 else {
              html.append("String_Node_Str");
            }
            html.append("String_Node_Str");
            html.append(w);
            html.append("String_Node_Str");
            html.append('>');
            int headerW=w;
            if (!hasAtLeastOneLabelFor)             headerW-=1;
            html.append("String_Node_Str");
            html.append(headerW).append("String_Node_Str");
            Object fontHeight=styleObj.get(CSS.Attribute.FONT_SIZE.toString());
            int cellHeight=13;
            if (fontHeight != null) {
              String sFontHeight=fontHeight.toString().toLowerCase();
              if (sFontHeight.endsWith("String_Node_Str") || sFontHeight.endsWith("String_Node_Str"))               sFontHeight=sFontHeight.substring(0,sFontHeight.length() - 2);
              try {
                cellHeight=Integer.parseInt(sFontHeight);
                cellHeight+=2;
              }
 catch (              NumberFormatException ex) {
                Debug.error(ex);
              }
            }
            html.append("String_Node_Str").append(cellHeight).append("String_Node_Str");
            styleObj.setProperty("String_Node_Str","String_Node_Str");
            styleObj.setProperty("String_Node_Str","String_Node_Str");
            styleObj.setProperty("String_Node_Str","String_Node_Str");
            styleObj.setProperty("String_Node_Str","String_Node_Str");
            TextualStyle sortLinkStyle=new TextualStyle();
            sortLinkStyle.setProperty("String_Node_Str","String_Node_Str");
            sortLinkStyle.setProperty("String_Node_Str",(headerW - SortableCellViewHeader.ARROW_WIDTH) + "String_Node_Str");
            if (sortable) {
              sortLinkStyle.setProperty("String_Node_Str",styleObj.getProperty("String_Node_Str"));
              html.append("String_Node_Str");
              html.append(sortLinkStyle.toString());
              html.append('>');
              html.append("String_Node_Str");
              styleObj.setProperty("String_Node_Str","String_Node_Str");
              html.append(styleObj.toString());
              html.append("String_Node_Str");
              html.append("String_Node_Str");
            }
 else {
              html.append("String_Node_Str");
              html.append(sortLinkStyle.toString());
              html.append('>');
              html.append("String_Node_Str");
              html.append(styleObj.toString());
              html.append("String_Node_Str");
              html.append("String_Node_Str");
            }
            html.append("String_Node_Str");
            if (sortable) {
              html.append("String_Node_Str");
            }
 else {
              html.append("String_Node_Str");
            }
            html.append("String_Node_Str");
            html.append("String_Node_Str");
          }
        }
      }
      if (!shouldFillAllHorizSpace) {
        html.append("String_Node_Str");
        if (bgColor != null) {
          html.append("String_Node_Str");
          html.append(PersistHelper.createColorString(bgColor));
          html.append("String_Node_Str");
        }
        html.append("String_Node_Str");
      }
      html.append("String_Node_Str");
    }
    html.append("String_Node_Str");
    StringBuffer columns=new StringBuffer();
    int colCount=0;
    Iterator<IPersist> it=obj.getAllObjects(PositionComparator.XY_PERSIST_COMPARATOR);
    int firstComponentHeight=-1;
    while (it.hasNext()) {
      IPersist element=it.next();
      if (element instanceof Field || element instanceof GraphicalComponent || element instanceof Bean) {
        if (element instanceof GraphicalComponent && ((GraphicalComponent)element).getLabelFor() != null) {
          continue;
        }
        Point l=((IFormElement)element).getLocation();
        if (l == null) {
          continue;
        }
        if (l.y >= startY && l.y < endY) {
          columns.append("String_Node_Str");
          if (element instanceof ISupportName) {
            String name=((ISupportName)element).getName();
            if (((name != null) && (name.trim().length() > 0)) || addHeaders) {
              columns.append("String_Node_Str");
              columns.append(ComponentFactory.getWebID(form,element));
              columns.append("String_Node_Str");
            }
          }
          if (firstComponentHeight == -1)           firstComponentHeight=((IFormElement)element).getSize().height;
          if (!addHeaders && !shouldFillAllHorizSpace) {
            columns.append("String_Node_Str");
            int w=((IFormElement)element).getSize().width;
            totalWidth+=w;
            columns.append(w);
            columns.append("String_Node_Str");
          }
          columns.append('>');
          columns.append("String_Node_Str");
          createComponentHTML(element,form,columns,css,bgColor,startY,endY,false,sp);
          TextualStyle idBasedStyle=css.addStyle('#' + ComponentFactory.getWebID(form,element));
          TextualStyle classBasedStyle=css.addStyle('.' + ComponentFactory.getWebID(form,element));
          classBasedStyle.copyAllFrom(idBasedStyle);
          if (element instanceof Field) {
            int type=((Field)element).getDisplayType();
            if (type == Field.PASSWORD || type == Field.TEXT_FIELD || type == Field.TYPE_AHEAD || type == Field.TEXT_AREA) {
              classBasedStyle.setProperty("String_Node_Str","String_Node_Str");
            }
          }
          columns.append("String_Node_Str");
          columns.append("String_Node_Str");
          colCount++;
        }
      }
    }
    if (!shouldFillAllHorizSpace) {
      columns.append("String_Node_Str");
      if (bgColor != null) {
        columns.append("String_Node_Str");
        columns.append(PersistHelper.createColorString(bgColor));
        columns.append("String_Node_Str");
      }
      columns.append("String_Node_Str");
    }
    html.append("String_Node_Str");
    html.append("String_Node_Str");
    html.append(firstComponentHeight);
    html.append("String_Node_Str");
    if ((obj instanceof ISupportRowBGColorScript) && (((ISupportRowBGColorScript)obj).getRowBGColorScript() == null || ((ISupportRowBGColorScript)obj).getRowBGColorScript().trim().length() == 0)) {
      html.append("String_Node_Str");
    }
    html.append("String_Node_Str");
    html.append(columns);
    html.append("String_Node_Str");
    html.append("String_Node_Str");
    html.append("String_Node_Str");
    html.append("String_Node_Str");
    html.append("String_Node_Str");
    html.append("String_Node_Str");
    html.append("String_Node_Str");
    if (!(obj instanceof Form)) {
      html.append("String_Node_Str");
    }
    html.append("String_Node_Str");
  }
  finally {
    css.removeCSSBoundsHandler();
  }
}

Fixed version (ground truth):
private static void createCellBasedView(AbstractBase obj,Form form,StringBuffer html,TextualCSS css,boolean addHeaders,int startY,int endY,Color bgColor,IServiceProvider sp) throws RepositoryException {
  try {
    html.append('\n');
    boolean sortable=true;
    boolean shouldFillAllHorizSpace=false;
    if (obj instanceof ISupportScrollbars) {
      int scrollbars=((ISupportScrollbars)obj).getScrollbars();
      if ((scrollbars & ISupportScrollbars.HORIZONTAL_SCROLLBAR_NEVER) == ISupportScrollbars.HORIZONTAL_SCROLLBAR_NEVER) {
        boolean hasAtLeastOneAnchored=false;
        Iterator<IPersist> it2=obj.getAllObjects(PositionComparator.XY_PERSIST_COMPARATOR);
        while (it2.hasNext()) {
          IPersist element=it2.next();
          if (element instanceof Field || element instanceof GraphicalComponent || element instanceof Bean) {
            if (element instanceof GraphicalComponent && ((GraphicalComponent)element).getLabelFor() != null) {
              continue;
            }
            Point l=((IFormElement)element).getLocation();
            if (l == null) {
              continue;
            }
            if (l.y >= startY && l.y < endY) {
              if (element instanceof ISupportAnchors) {
                int anchors=((ISupportAnchors)element).getAnchors();
                if (((anchors & IAnchorConstants.EAST) != 0) && ((anchors & IAnchorConstants.WEST) != 0)) {
                  hasAtLeastOneAnchored=true;
                  break;
                }
              }
            }
          }
        }
        if (hasAtLeastOneAnchored)         shouldFillAllHorizSpace=true;
      }
    }
    if (obj instanceof Form) {
      html.append("String_Node_Str");
    }
 else {
      Portal p=(Portal)obj;
      sortable=p.getSortable();
      TextualStyle styleObj=css.addStyle('#' + ComponentFactory.getWebID(form,p));
      BorderAndPadding ins=applyBaseComponentProperties(p,form,styleObj,null,null,sp);
      applyLocationAndSize(p,styleObj,ins,startY,endY,form.getSize().width,true);
      html.append("String_Node_Str");
      html.append(getWicketIDParameter(form,p));
      html.append(getCSSClassParameter("String_Node_Str"));
      html.append("String_Node_Str");
    }
    css.addCSSBoundsHandler(NoLocationCSSBoundsHandler.INSTANCE);
    html.append("String_Node_Str");
    int totalWidth=0;
    if (addHeaders) {
      Map<String,GraphicalComponent> labelsFor=new HashMap<String,GraphicalComponent>();
      html.append("String_Node_Str");
      html.append("String_Node_Str");
      html.append("String_Node_Str");
      Iterator<IPersist> it1=obj.getAllObjects(PositionComparator.XY_PERSIST_COMPARATOR);
      while (it1.hasNext()) {
        IPersist element=it1.next();
        if (element instanceof GraphicalComponent && ((GraphicalComponent)element).getLabelFor() != null) {
          labelsFor.put(((GraphicalComponent)element).getLabelFor(),(GraphicalComponent)element);
        }
      }
      boolean usesImageMedia=false;
      boolean hasAtLeastOneLabelFor=false;
      int totalColumnsCount=0;
      Iterator<IPersist> it2=obj.getAllObjects(PositionComparator.XY_PERSIST_COMPARATOR);
      while (it2.hasNext()) {
        IPersist element=it2.next();
        if (element instanceof Field || element instanceof GraphicalComponent || element instanceof Bean) {
          if (element instanceof GraphicalComponent && ((GraphicalComponent)element).getLabelFor() != null) {
            continue;
          }
          Point l=((IFormElement)element).getLocation();
          if (l == null) {
            continue;
          }
          if (l.y >= startY && l.y < endY) {
            totalColumnsCount++;
            GraphicalComponent label=labelsFor.get(((IFormElement)element).getName());
            if (label != null)             hasAtLeastOneLabelFor=true;
          }
        }
      }
      int currentColumnCount=0;
      it2=obj.getAllObjects(PositionComparator.XY_PERSIST_COMPARATOR);
      while (it2.hasNext()) {
        IPersist element=it2.next();
        if (element instanceof Field || element instanceof GraphicalComponent || element instanceof Bean) {
          if (element instanceof GraphicalComponent && ((GraphicalComponent)element).getLabelFor() != null) {
            continue;
          }
          Point l=((IFormElement)element).getLocation();
          if (l == null) {
            continue;
          }
          if (l.y >= startY && l.y < endY) {
            currentColumnCount++;
            html.append("String_Node_Str");
            html.append(getWicketIDParameter(form,element));
            int w=((IFormElement)element).getSize().width;
            totalWidth+=w;
            w=w - 2;
            TextualStyle styleObj=new TextualStyle();
            GraphicalComponent label=labelsFor.get(((IFormElement)element).getName());
            if (label != null) {
              html.append(' ');
              BorderAndPadding ins=applyBaseComponentProperties(label,form,styleObj,(Insets)DEFAULT_LABEL_PADDING.clone(),null,sp);
              Pair<FixedStyleSheet,javax.swing.text.Style> styleInfo=ComponentFactory.getStyleForBasicComponent(sp,label,form);
              Border cssBorder=null;
              if (styleInfo != null) {
                javax.swing.text.Style s=styleInfo.getRight();
                FixedStyleSheet ss=styleInfo.getLeft();
                if (ss != null && s != null) {
                  addAttributeToStyle(styleObj,CSS.Attribute.COLOR.toString(),s.getAttribute(CSS.Attribute.COLOR));
                  addAttributeToStyle(styleObj,CSS.Attribute.BACKGROUND_COLOR.toString(),s.getAttribute(CSS.Attribute.BACKGROUND_COLOR));
                  addAttributeToStyle(styleObj,CSS.Attribute.FONT.toString(),s.getAttribute(CSS.Attribute.FONT));
                  addAttributeToStyle(styleObj,CSS.Attribute.FONT_FAMILY.toString(),s.getAttribute(CSS.Attribute.FONT_FAMILY));
                  addAttributeToStyle(styleObj,CSS.Attribute.FONT_SIZE.toString(),s.getAttribute(CSS.Attribute.FONT_SIZE));
                  addAttributeToStyle(styleObj,CSS.Attribute.FONT_STYLE.toString(),s.getAttribute(CSS.Attribute.FONT_STYLE));
                  addAttributeToStyle(styleObj,CSS.Attribute.FONT_VARIANT.toString(),s.getAttribute(CSS.Attribute.FONT_VARIANT));
                  addAttributeToStyle(styleObj,CSS.Attribute.FONT_WEIGHT.toString(),s.getAttribute(CSS.Attribute.FONT_WEIGHT));
                  cssBorder=ss.getBorder(s);
                }
              }
              if (ins.border != null)               w=w - ins.border.left - ins.border.right;
              applyTextProperties(label,styleObj);
              TextualStyle bgborderstyleObj=new TextualStyle();
              if (!sortable) {
                bgborderstyleObj.setProperty("String_Node_Str",styleObj.getProperty("String_Node_Str"));
                bgborderstyleObj.setProperty("String_Node_Str",styleObj.getProperty("String_Node_Str"));
              }
              if (label.getImageMediaID() <= 0) {
                bgborderstyleObj.setProperty("String_Node_Str","String_Node_Str");
                usesImageMedia=false;
              }
 else {
                usesImageMedia=true;
              }
              bgborderstyleObj.setProperty("String_Node_Str",styleObj.getProperty("String_Node_Str"));
              if (styleObj.getProperty(CSS.Attribute.FONT_WEIGHT.toString()) == null) {
                bgborderstyleObj.setProperty(CSS.Attribute.FONT_WEIGHT.toString(),"String_Node_Str",false);
              }
              if (cssBorder != null && label.getBorderType() == null)               ComponentFactoryHelper.createBorderCSSProperties(ComponentFactoryHelper.createBorderString(cssBorder),bgborderstyleObj);
 else               ComponentFactoryHelper.createBorderCSSProperties(label.getBorderType(),bgborderstyleObj);
              bgborderstyleObj.setProperty(CSS.Attribute.HEIGHT.toString(),label.getSize().height + "String_Node_Str");
              html.append(bgborderstyleObj.toString());
              Enumeration<Object> e=bgborderstyleObj.keys();
              while (e.hasMoreElements()) {
                String key=(String)e.nextElement();
                styleObj.remove(key);
              }
            }
 else {
              if (!hasAtLeastOneLabelFor) {
                TextualStyle defaultBorder=new TextualStyle();
                defaultBorder.setProperty("String_Node_Str",NO_LABELFOR_DEFAULT_BORDER_WIDTH + "String_Node_Str");
                html.append(defaultBorder.toString());
              }
            }
            if (sortable && !usesImageMedia) {
              html.append("String_Node_Str");
            }
 else {
              html.append("String_Node_Str");
            }
            html.append("String_Node_Str");
            html.append(w);
            html.append("String_Node_Str");
            html.append('>');
            int headerW=w;
            if (!hasAtLeastOneLabelFor)             headerW-=1;
            html.append("String_Node_Str");
            html.append(headerW).append("String_Node_Str");
            Object fontHeight=styleObj.get(CSS.Attribute.FONT_SIZE.toString());
            int cellHeight=13;
            if (fontHeight != null) {
              String sFontHeight=fontHeight.toString().toLowerCase();
              if (sFontHeight.endsWith("String_Node_Str") || sFontHeight.endsWith("String_Node_Str"))               sFontHeight=sFontHeight.substring(0,sFontHeight.length() - 2);
              try {
                cellHeight=Integer.parseInt(sFontHeight);
                cellHeight+=2;
              }
 catch (              NumberFormatException ex) {
                Debug.error(ex);
              }
            }
            html.append("String_Node_Str").append(cellHeight).append("String_Node_Str");
            styleObj.setProperty("String_Node_Str","String_Node_Str");
            styleObj.setProperty("String_Node_Str","String_Node_Str");
            styleObj.setProperty("String_Node_Str","String_Node_Str");
            styleObj.setProperty("String_Node_Str","String_Node_Str");
            TextualStyle sortLinkStyle=new TextualStyle();
            sortLinkStyle.setProperty("String_Node_Str","String_Node_Str");
            sortLinkStyle.setProperty("String_Node_Str",(headerW - SortableCellViewHeader.ARROW_WIDTH) + "String_Node_Str");
            if (sortable) {
              sortLinkStyle.setProperty("String_Node_Str",styleObj.getProperty("String_Node_Str"));
              html.append("String_Node_Str");
              html.append(sortLinkStyle.toString());
              html.append('>');
              html.append("String_Node_Str");
              styleObj.setProperty("String_Node_Str","String_Node_Str");
              html.append(styleObj.toString());
              html.append("String_Node_Str");
              html.append("String_Node_Str");
            }
 else {
              html.append("String_Node_Str");
              html.append(sortLinkStyle.toString());
              html.append('>');
              html.append("String_Node_Str");
              html.append(styleObj.toString());
              html.append("String_Node_Str");
              html.append("String_Node_Str");
            }
            html.append("String_Node_Str");
            if (sortable) {
              html.append("String_Node_Str");
            }
 else {
              html.append("String_Node_Str");
            }
            html.append("String_Node_Str");
            html.append("String_Node_Str");
          }
        }
      }
      if (!shouldFillAllHorizSpace) {
        html.append("String_Node_Str");
        if (bgColor != null) {
          html.append("String_Node_Str");
          html.append(PersistHelper.createColorString(bgColor));
          html.append("String_Node_Str");
        }
        html.append("String_Node_Str");
      }
      html.append("String_Node_Str");
    }
    html.append("String_Node_Str");
    StringBuffer columns=new StringBuffer();
    int colCount=0;
    Iterator<IPersist> it=obj.getAllObjects(PositionComparator.XY_PERSIST_COMPARATOR);
    int firstComponentHeight=-1;
    while (it.hasNext()) {
      IPersist element=it.next();
      if (element instanceof Field || element instanceof GraphicalComponent || element instanceof Bean) {
        if (element instanceof GraphicalComponent && ((GraphicalComponent)element).getLabelFor() != null) {
          continue;
        }
        Point l=((IFormElement)element).getLocation();
        if (l == null) {
          continue;
        }
        if (l.y >= startY && l.y < endY) {
          columns.append("String_Node_Str");
          if (element instanceof ISupportName) {
            String name=((ISupportName)element).getName();
            if (((name != null) && (name.trim().length() > 0)) || addHeaders) {
              columns.append("String_Node_Str");
              columns.append(ComponentFactory.getWebID(form,element));
              columns.append("String_Node_Str");
            }
          }
          if (firstComponentHeight == -1)           firstComponentHeight=((IFormElement)element).getSize().height;
          if (!addHeaders && !shouldFillAllHorizSpace) {
            columns.append("String_Node_Str");
            int w=((IFormElement)element).getSize().width;
            totalWidth+=w;
            columns.append(w);
            columns.append("String_Node_Str");
          }
          columns.append('>');
          columns.append("String_Node_Str" + TABLE_VIEW_CELL_CLASS + "String_Node_Str");
          createComponentHTML(element,form,columns,css,bgColor,startY,endY,false,sp);
          TextualStyle idBasedStyle=css.addStyle('#' + ComponentFactory.getWebID(form,element));
          TextualStyle classBasedStyle=css.addStyle('.' + ComponentFactory.getWebID(form,element));
          classBasedStyle.copyAllFrom(idBasedStyle);
          if (element instanceof Field) {
            int type=((Field)element).getDisplayType();
            if (type == Field.PASSWORD || type == Field.TEXT_FIELD || type == Field.TYPE_AHEAD || type == Field.TEXT_AREA) {
              classBasedStyle.setProperty("String_Node_Str","String_Node_Str");
            }
          }
          columns.append("String_Node_Str");
          columns.append("String_Node_Str");
          colCount++;
        }
      }
    }
    if (!shouldFillAllHorizSpace) {
      columns.append("String_Node_Str");
      if (bgColor != null) {
        columns.append("String_Node_Str");
        columns.append(PersistHelper.createColorString(bgColor));
        columns.append("String_Node_Str");
      }
      columns.append("String_Node_Str");
    }
    html.append("String_Node_Str");
    html.append("String_Node_Str");
    html.append(firstComponentHeight);
    html.append("String_Node_Str");
    if ((obj instanceof ISupportRowBGColorScript) && (((ISupportRowBGColorScript)obj).getRowBGColorScript() == null || ((ISupportRowBGColorScript)obj).getRowBGColorScript().trim().length() == 0)) {
      html.append("String_Node_Str");
    }
    html.append("String_Node_Str");
    html.append(columns);
    html.append("String_Node_Str");
    html.append("String_Node_Str");
    html.append("String_Node_Str");
    html.append("String_Node_Str");
    html.append("String_Node_Str");
    html.append("String_Node_Str");
    html.append("String_Node_Str");
    if (!(obj instanceof Form)) {
      html.append("String_Node_Str");
    }
    html.append("String_Node_Str");
  }
  finally {
    css.removeCSSBoundsHandler();
  }
}