public Tree createJSFTree(UIComponent parent) {
Map nodeMap = null;
UIComponent child = null;
String type = null;
String methodName = null;
Tree tree = null;
// Get the interator...
Iterator<Map> it = _maps.iterator();
if (!it.hasNext()) {
return null;
}
//Get the application name from the methodStart row.
String application = "";
for(int i=0; i<_maps.size(); i++){
Map ms = _maps.get(i);
String rowType = (String) ms.get(CallFlowMonitor.CALL_STACK_ROW_TYPE_KEY);
if(rowType.equals(CallFlowMonitor.CALL_STACK_METHOD_START )){
application = (String) ms.get(CallFlowMonitor.APPLICATION_NAME_KEY );
if(! GuiUtil.isEmpty(application))
break;
}
}
// Process first Map (should be RequestStart)
nodeMap = (Map) it.next();
if (!((String) nodeMap.get(CallFlowMonitor.CALL_STACK_ROW_TYPE_KEY)).
equals(CallFlowMonitor.CALL_STACK_REQUEST_START)) {
throw new RuntimeException("CallFlow stack should begin with "
+ "RequestStart, instead got: '"
+ nodeMap.get(CallFlowMonitor.CALL_STACK_ROW_TYPE_KEY) + "'.");
}
Properties props = new Properties();
props.put("expanded", Boolean.TRUE);
//ensure application is not null
if (application == null) application = "";
props.put("text", application);
//props.put("imageURL", ...);
child = ComponentUtil.getChild(parent, "callFlowTree",
"com.sun.jsftemplating.component.factory.sun.TreeFactory",
props);
parent.getChildren().add(child);
tree = (Tree) child;
tree.setClientSide(false);
int idx = 0;
while (it.hasNext()) {
nodeMap = (Map) it.next();
type = (String) nodeMap.get(CallFlowMonitor.CALL_STACK_ROW_TYPE_KEY);