public CustomList(CustomListStyle style, CellRenderer<T> r) { selection = new ArraySelection<T>(items); selection.setActor(this); selection.setRequired(true); cellRenderer = r; setStyle(style); setSize(getPrefWidth(), getPrefHeight()); addListener(new InputListener() { public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) { if (pointer == 0 && button != 0) return false; if (selection.isDisabled()) return false; CustomList.this.touchDown(y); return true; } }); }
@Override public boolean canProcess(final Field field, final Object actor) { return actor instanceof List<?> && field.getType().equals(ArraySelection.class); }
@Override public boolean canProcess(final Field field, final Object actor) { return actor instanceof SelectBox<?> && field.getType().equals(ArraySelection.class); }
/** Get the set of selected items, useful when multiple items are selected * @return a Selection object containing the selected elements */ public ArraySelection<T> getSelection () { return selection; }
public ArraySelection<T> getSelection () { return selection; }
public ArraySelection<T> getSelection() { return selection; }