/** Removes the child item in the list box at the given index. * @return the removed item. */ public Comboitem removeItemAt(int index) { final Comboitem item = getItemAtIndex(index); removeChild(item); return item; }
public Component getComponentAtIndexByOwner(Component comp, int index) { if (comp instanceof Combobox) { return ((Combobox) comp).getItemAtIndex(index); } else { throw new UiException("Unsupported type for ComboitemCollectionItem: " + comp); } }
/** Deselects the currently selected items and selects * the item with the given index. * <p>Note: if the label of comboitem has the same more than one, the first * comboitem will be selected at client side, it is a limitation of {@link Combobox} * and it is different from {@link Listbox}.</p> * @since 3.0.2 */ public void setSelectedIndex(int jsel) { if (jsel >= getItemCount()) throw new UiException("Out of bound: " + jsel + " while size=" + getItemCount()); if (jsel < -1) jsel = -1; setSelectedItem(jsel >= 0 ? getItemAtIndex(jsel) : null); //Bug#2919037: setSelectedIndex(-1) shall unselect even with constraint }
final Comboitem item = cbbox.getItemAtIndex(index);
final Component next = min < oldsz ? getItemAtIndex(min) : null; int index = min; try { Component comp = getItemAtIndex(max); while (--cnt >= 0) { Component p = comp.getPreviousSibling();