Example usage for com.badlogic.gdx.scenes.scene2d.ui SelectBox clearItems

List of usage examples for com.badlogic.gdx.scenes.scene2d.ui SelectBox clearItems

Introduction

In this page you can find the example usage for com.badlogic.gdx.scenes.scene2d.ui SelectBox clearItems.

Prototype

public void clearItems() 

Source Link

Usage

From source file:com.bladecoder.engineeditor.ui.EditAnimationDialog.java

License:Apache License

private void fillAnimations() {
    @SuppressWarnings("unchecked")
    SelectBox<String> cb = (SelectBox<String>) id.getField();
    cb.clearItems();

    // When creating, give option to add all elements
    if (e == null)
        cb.getItems().add("<ADD ALL>");

    String ids[] = spriteWidget.getAnimations();
    for (String s : ids)
        cb.getItems().add(s);/* w  w  w .  j  a  v a  2  s . c  om*/

    cb.getList().setItems(cb.getItems());
    if (cb.getItems().size > 0)
        cb.setSelectedIndex(0);

    cb.invalidateHierarchy();

    setAnimation();
}