public static DataItemHandle findSlotColumn(SlotHandle slotHandle, String columnName) throws Exception {
DataItemHandle itemHandle = null;
for (Iterator<SlotHandle> iterator = slotHandle.iterator();
iterator.hasNext() && itemHandle==null;){
Object slotObject = iterator.next();
if (slotObject instanceof TableHandle){
TableHandle tableHandle = (TableHandle)slotObject;
itemHandle = findSlotColumn(tableHandle.getHeader(), columnName);
if (itemHandle==null){
itemHandle = findSlotColumn(tableHandle.getDetail(), columnName);
if (itemHandle==null){
itemHandle = findSlotColumn(tableHandle.getFooter(), columnName);
if (itemHandle==null){
itemHandle = findSlotColumn(tableHandle.getColumns(), columnName);
}
}
}
}else if (slotObject instanceof GridHandle){
GridHandle gridHandle = (GridHandle)slotObject;
itemHandle = findSlotColumn(gridHandle.getRows(), columnName);
if (itemHandle==null){
itemHandle = findSlotColumn(gridHandle.getColumns(), columnName);
}
}else if (slotObject instanceof RowHandle){
RowHandle rowHandle = (RowHandle)slotObject;
itemHandle = findSlotColumn(rowHandle.getCells(), columnName);
}else if (slotObject instanceof CellHandle){
CellHandle cellHandle = (CellHandle)slotObject;
itemHandle = findSlotColumn(cellHandle.getContent(), columnName);
}else if (slotObject instanceof DataItemHandle){
DataItemHandle itemHandle2=(DataItemHandle)slotObject;
if (itemHandle2.getResultSetColumn().equals(columnName)){
itemHandle=itemHandle2;
}
}
}
return itemHandle;
}