[]
ICellLinkControl, ICellLinkControlT<Integer>, IControl, ISelectorThis interface extends ISelector with item-based access for controls such as IDropDown and IListBox. Use getItems() to manage the control's child items, getSelectedItem() to retrieve the current selection. The items list is read-only when ISelector.getItemsSourceRange() is set.
ISelectorT<DropDownItem, IDropDownItemList> selector =
worksheet.getControls().addDropDown(20, 20, 120, 20);
selector.getItems().add(new DropDownItem("Pending"));
selector.getItems().add(new DropDownItem("Approved"));
selector.setSelectedItem(selector.getItems().get(1));
getItems()getDisplay3DShading, getLinkedCell, setDisplay3DShading, setLinkedCellgetValue, setValuebringToFront, delete, getBottomRightCell, getEnabled, getFormControlType, getHeight, getLeft, getLocked, getName, getParent, getPlacement, getPrintObject, getShapeRange, getTop, getTopLeftCell, getVisible, getWidth, getZOrder, sendToBack, setEnabled, setHeight, setLeft, setLocked, setName, setPlacement, setPrintObject, setTop, setVisible, setWidthgetItemsSourceRange, getSelectedIndex, setItemsSourceRange, setSelectedIndexReturns the item list that defines the selectable content of the control. The list is read-only if ISelector.getItemsSourceRange() is set.
IDropDown dropDown = worksheet.getControls().addDropDown(20, 20, 120, 24);
dropDown.getItems().add(new DropDownItem("Name"));
dropDown.getItems().add(new DropDownItem("Value"));
IDropDownItemList items = dropDown.getItems();
Returns the item that corresponds to the current selected index, or null if no item is selected.
IDropDown selector = worksheet.getControls().addDropDown(20, 20, 120, 20);
selector.getItems().add(new DropDownItem("Pending"));
selector.getItems().add(new DropDownItem("Approved"));
selector.setSelectedItem(selector.getItems().get(1));
DropDownItem selectedItem = selector.getSelectedItem();
null if no item is selected.IndexOutOfBoundsException could occur if items are lost.