private int getSelectedIndex(@Nonnull final ListBoxSelectionChangedEvent<?> data) { int selectedItemIndex = -1; List<Integer> selectionIndices = data.getSelectionIndices(); if (!selectionIndices.isEmpty()) { selectedItemIndex = selectionIndices.get(0); } return selectedItemIndex; }
private int getSelectedIndex(@Nonnull final ListBoxSelectionChangedEvent<?> data) { int selectedItemIndex = -1; List<Integer> selectionIndices = data.getSelectionIndices(); if (!selectionIndices.isEmpty()) { selectedItemIndex = selectionIndices.get(0); } return selectedItemIndex; }
public TreeItemSelectionChangedEvent( @Nonnull final TreeBox<T> treeBoxControl, @Nonnull final ListBoxSelectionChangedEvent<TreeItem<T>> org) { super(treeBoxControl, org.getSelection(), org.getSelectionIndices()); this.treeBoxControl = treeBoxControl; }
public TreeItemSelectionChangedEvent( @Nonnull final TreeBox<T> treeBoxControl, @Nonnull final ListBoxSelectionChangedEvent<TreeItem<T>> org) { super(treeBoxControl, org.getSelection(), org.getSelectionIndices()); this.treeBoxControl = treeBoxControl; }
@NiftyEventSubscriber(id = "mapsTable") public void onListBoxSelectionChanged(final String id, final ListBoxSelectionChangedEvent<TableRow> event) { if (event.getSelectionIndices().isEmpty()) { return; } KwdFile map = state.mapSelector.getMaps().get(event.getSelectionIndices().get(0)).getMap(); if (state.mapSelector.isMPD()) { // on mpd we show the briefing state.selectedLevel = new CustomMPDLevel(map); goToScreen("briefing"); } else { // The map title populateSelectedMap(map); } }