profileTable.appendCell(rowIndex).setInnerHTML("<b>Resource</b>");
profileTable.appendCell(rowIndex).setInnerHTML("<b>Self Time</b>");
profileTable.appendCell(rowIndex).setInnerHTML("<b>Time</b>");
for (int length = children.size(); rowIndex < length; ++rowIndex) {
JavaScriptProfileNode child = children.get(rowIndex);
// Truncate the display by default to show only nodes where self time
// occurred.
if (child.getSelfTime() <= 0 && (length - rowIndex > 4)
|| rowIndex > FLAT_PROFILE_PAGE_SIZE) {
break;
}
addFlatChild(child, profileTable);
}
// Profile terminated early, add a "show more" indicator
if (rowIndex < children.size()) {
profileTable.appendRow();
TableCellElement cell = profileTable.appendCell(rowIndex + 1);
cell.setColSpan(4);
Anchor anchor = new Anchor(new DefaultContainerImpl(cell));
anchor.setText("More...");
anchor.setHref("javascript:;");
cell.appendChild(anchor.getElement());
final int moreRowIndex = rowIndex;
listenerManager.manageEventListener(anchor.addClickListener(new ClickListener() {
public void onClick(ClickEvent event) {
profileTable.deleteRow(moreRowIndex + 1);
for (int i = moreRowIndex; i < children.size(); ++i) {
JavaScriptProfileNode child = children.get(i);
addFlatChild(child, profileTable);
}
if (resizeCallback != null) {
resizeCallback.onResize();
}