int indexedChildCount = parent.getIndexedChildCount(context);
int modelChildCount = component.getRowCount();
int totalChildCount = indexedChildCount + modelChildCount;
int selectedIndex = component.getRowIndex();
ListDataObjectList list = new ListDataObjectList(totalChildCount);
BaseLafUtils.setRenderingProperty(context, _DATA_OBJECT_LIST_KEY, list);
__setDataObjectUsedMode(context, true);
// need newSelectedIndex and newIndex because the selectedIndex passed in
// ignores what is and isn't rendered, but the list only has
// what is rendered, so newIndex and newSelectedIndex deal with that.
int newSelectedIndex = -1;
int newIndex = 0;
for (int i = 0; i < modelChildCount; i++)
{
component.setRowIndex(i);
boolean includeStamp = true;
/*if (checkStampType)
{
Object type = stamp.getAttributeValue(context, UIConstants.TYPE_ATTR);
if (CoreCommandNavigationItem.TYPE_GLOBAL.equals(type))
includeStamp = false;
}*/
if (includeStamp)
{
// needed for TrainRenderer. It is important to know what child index
// this is, not just the index of the visible children.
LinkDataObject.__setCurrentIndex(context, i);
if ((stamp != null) &&
!Boolean.FALSE.equals(
stamp.getAttributeValue(context, UIConstants.RENDERED_ATTR)))
{
context.pushChild(stamp, null, i);
context.pushRenderedChild(context, stamp);
try
{
if ( i == selectedIndex)
newSelectedIndex = newIndex;
stamp.render(context);
}
finally
{
context.popRenderedChild(context);
context.popChild();
}
newIndex++;
}
LinkDataObject.__setCurrentIndex(context, null);
}
}
if ( newSelectedIndex > -1)
{
LinkDataObject ldo = (LinkDataObject)list.getItem(newSelectedIndex);
ldo.setSelected(true);
}
for (int childIndex = 0; childIndex < indexedChildCount; childIndex++)
{