private MenuItem findItem(Element hItem) { for (int i = 0; i < items.size(); ++i) { final MenuItem item = items.get(i); if (DOM.isOrHasChild(item.getElement(), hItem)) { return item; } } return null; }
/** * Adds a menu item to the bar. * * @param item the item to be added */ public void addItem(MenuItem item) { Element tr; if (vertical) { tr = DOM.createTR(); DOM.appendChild(body, tr); } else { tr = DOM.getChild(body, 0); } DOM.appendChild(tr, item.getElement()); item.setParentMenu(this); item.setSelectionStyle(false); items.add(item); }