/** Sets the selection to only the selected index. */ public void setSelectedIndex (int index) { selection.set(items.get(index)); }
/** Sets the selection to only the selected index. */ public void setSelectedIndex (int index) { selection.set(items.get(index)); }
/** Sets the selection to only the selected index. * @param index -1 to clear the selection. */ public void setSelectedIndex (int index) { if (index < -1 || index >= items.size) throw new IllegalArgumentException("index must be >= -1 and < " + items.size + ": " + index); if (index == -1) { selection.clear(); } else { selection.set(items.get(index)); } }
/** Sets the selection to only the selected index. * @param index -1 to clear the selection. */ public void setSelectedIndex (int index) { if (index < -1 || index >= items.size) throw new IllegalArgumentException("index must be >= -1 and < " + items.size + ": " + index); if (index == -1) { selection.clear(); } else { selection.set(items.get(index)); } }
/** Sets the selection to only the passed item, if it is a possible choice. * @param item May be null. */ public void setSelected (T item) { if (items.contains(item, false)) selection.set(item); else if (selection.getRequired() && items.size > 0) selection.set(items.first()); else selection.clear(); }
/** Sets the selection to only the passed item, if it is a possible choice. * @param item May be null. */ public void setSelected (T item) { if (items.contains(item, false)) selection.set(item); else if (selection.getRequired() && items.size > 0) selection.set(items.first()); else selection.clear(); }
public void exit (InputEvent event, float x, float y, int pointer, Actor toActor) { if (toActor == null || !isAscendantOf(toActor)) list.selection.set(selectBox.getSelected()); } });
public void exit (InputEvent event, float x, float y, int pointer, Actor toActor) { if (toActor == null || !isAscendantOf(toActor)) list.selection.set(selectBox.getSelected()); } });
/** Removes objects from the selection that are no longer in the items array. If {@link #getRequired()} is true and there is no * selected item, the first item is selected. */ public void validate () { Array<T> array = this.array; if (array.size == 0) { clear(); return; } for (Iterator<T> iter = items().iterator(); iter.hasNext();) { T selected = iter.next(); if (!array.contains(selected, false)) iter.remove(); } if (required && selected.size == 0) set(array.first()); } }
/** Removes objects from the selection that are no longer in the items array. If {@link #getRequired()} is true and there is no * selected item, the first item is selected. */ public void validate () { Array<T> array = this.array; if (array.size == 0) { clear(); return; } for (Iterator<T> iter = items().iterator(); iter.hasNext();) { T selected = iter.next(); if (!array.contains(selected, false)) iter.remove(); } if (required && selected.size == 0) set(array.first()); } }
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) { Actor target = event.getTarget(); if (isAscendantOf(target)) return false; list.selection.set(selectBox.getSelected()); hide(); return false; }
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) { Actor target = event.getTarget(); if (isAscendantOf(target)) return false; list.selection.set(selectBox.getSelected()); hide(); return false; }
stage.setScrollFocus(this); list.selection.set(selectBox.getSelected()); list.setTouchable(Touchable.enabled); clearActions();
stage.setScrollFocus(this); list.selection.set(selectBox.getSelected()); list.setTouchable(Touchable.enabled); clearActions();
/** Sets the selection to only the selected index. * @param index -1 to clear the selection. */ public void setSelectedIndex (int index) { if (index < -1 || index >= items.size) throw new IllegalArgumentException("index must be >= -1 and < " + items.size + ": " + index); if (index == -1) { selection.clear(); } else { selection.set(items.get(index)); } }
/** Sets the selection to only the passed item, if it is a possible choice. * @param item May be null. */ public void setSelected (T item) { if (items.contains(item, false)) selection.set(item); else if (selection.getRequired() && items.size > 0) selection.set(items.first()); else selection.clear(); }
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) { Actor target = event.getTarget(); if (isAscendantOf(target)) return false; list.selection.set(selectBox.getSelected()); hide(); return false; }