/** * If the added item is marked as selected, set it as the selected item. * * @see org.fujion.component.BaseComponent#afterAddChild(org.fujion.component.BaseComponent) */ @Override protected void afterAddChild(BaseComponent child) { Comboitem item = (Comboitem) child; if (item.isSelected()) { _updateSelected(item); } }
/** * Sets the currently selected item. * * @param item The combo item to select, or null for no selection. */ public void setSelectedItem(Comboitem item) { validateIsChild(item); if (item == null) { _updateSelected(item); } else { item.setSelected(true); } }
/** * Sets the selection state. * * @param selected The selection state. * @param notifyClient If true, notify the client of the state change. * @param notifyParent If true, notify the parent of the state change. */ protected void _setSelected(boolean selected, boolean notifyClient, boolean notifyParent) { if (propertyChange("selected", this.selected, this.selected = selected, notifyClient)) { if (notifyParent && getParent() != null) { getCombobox()._updateSelected(selected ? this : null); } } }