protected void onDeleteClicked() { if (selectedConfigsList.getSelectionCount() == 0) { return; } String[] selection = selectedConfigsList.getSelection(); StringBuilder b = new StringBuilder(); for (String item : selection) { if (b.length() > 0) { b.append(", "); } b.append(item); } int response = ask( "Are you shure you want to remove [" + b.toString() + "]?", "Removing launch configuration"); if (response != SWT.YES) { return; } selectedConfigsList.remove(selectedConfigsList.getSelectionIndices()); for (String item : selection) { if (allConfigNames.contains((String) item)) { availableConfigsCombo.add(item); } } updateButtonsState(); updateLaunchConfigurationDialog(); }
public void handleEvent(Event event) { String input; for (int i : list.getSelectionIndices()) { input = list.getItem(i).split(" ")[0]; getController().notifyEbookChanged(input); } }
private void ok() { if (wSelection.getSelectionCount() > 0) { selection = wSelection.getSelection()[0]; selectionNr = wSelection.getSelectionIndices()[0]; if (quickSearch) { for (int i = 0; i < choices.length; i++) { if (choices[i].equals(selection)) { selectionNr = i; } } } // We need to handle the indices properly. If a filter is applied, the wSelection will differ // from choices // So we have to get the current index from choices and store it in the indices String[] selections = wSelection.getSelection(); boolean found = false; indices = new int[selections.length]; for (int i = 0; i < selections.length; i++) { found = false; for (int j = 0; j < choices.length; j++) { if (selections[i].equals(choices[j])) { indices[i] = j; found = true; break; } } } if (!found) { indices = wSelection.getSelectionIndices(); } } else { selection = null; selectionNr = -1; indices = new int[0]; } dispose(); }
@Override protected int[] listGetSelectionIndices() { return list.getSelectionIndices(); }
private void handleIgnoreRemoveButtonPressed() { int[] selections = ignoreRangesList.getSelectionIndices(); ignoreRangesList.remove(selections); }