示例#1
0
 public void setSelectedIndex(final int index, final boolean selected) {
   checkIndex(index);
   this.selectedIndex = index;
   final Update update = new Update(getID());
   update.put(PROPERTY.SELECTED, selected);
   update.put(PROPERTY.SELECTED_INDEX, index);
   getUIContext().stackInstruction(update);
 }
示例#2
0
  public ListItem removeItem(final int index) {
    checkIndex(index);

    if (selectedItems.contains(index)) selectedItems.remove(Integer.valueOf(index));

    final ListItem removedItem = items.remove(index);
    sendRemoveItemInstruction(index);
    return removedItem;
  }
示例#3
0
  public void setItemText(final int index, final String text) {
    checkIndex(index);

    items.get(index).label = text;

    final Update update = new Update(getID());
    update.put(PROPERTY.ITEM_UPDATED);
    update.put(PROPERTY.INDEX, index);
    update.put(PROPERTY.ITEM_TEXT, text);

    getUIContext().stackInstruction(update);
  }
示例#4
0
 public Object getValue(final int index) {
   checkIndex(index);
   return items.get(index).value;
 }
示例#5
0
 public void setValue(final int index, final Object value) {
   checkIndex(index);
   items.get(index).value = value;
 }