/**
* Fills {@link #m_widgetHandles}.
*/
private void prepareWidgetHandles() throws Exception {
GwtState state = getState();
DOMUtils dom = state.getDomUtils();
m_widgetHandles.clear();
m_widgetToHandleBounds.clear();
// prepare table row with tabs
Object tabBarRowElement;
{
Object panelObject = getObject();
Object tabBarWidget = ReflectionUtils.invokeMethod(panelObject, "getTabBar()");
Object tabBarElement = state.getUIObjectUtils().getElement(tabBarWidget);
Object tabBarBodyElement = dom.getChild(tabBarElement, 0);
tabBarRowElement = dom.getChild(tabBarBodyElement, 0);
}
// fetch tabs bounds for each widget
List<WidgetInfo> widgets = getChildrenWidgets();
for (int index = 0; index < widgets.size(); index++) {
WidgetInfo widget = widgets.get(index);
// use "1 +" because first TD is "gwt-TabBarFirst"
Object tabElement = dom.getChild(tabBarRowElement, 1 + index);
tabElement = dom.getChild(tabElement, 0);
Rectangle tabBounds = state.getAbsoluteBounds(tabElement);
absoluteToRelative(tabBounds);
// remember tab and bounds
m_widgetHandles.add(new WidgetHandle(widget));
m_widgetToHandleBounds.put(widget, tabBounds);
}