@Test(expected=IllegalArgumentException.class) public final void testSetSelectedValuesWithInvalidSelection() throws Exception { final ArrayList<String> selectedValues = new ArrayList<String>(2); selectedValues.add("oranges"); lms.setSelectedValues(selectedValues); }
public void setSelectedValues(final List<T> vals) { if (vals == null) throw new NullPointerException("value list is null"); for (T v : vals) if (!values.contains(v)) throw new IllegalArgumentException("value not contained in list of possible values\n possible items = "+this.getPossibleValues()); selected = new ArrayList<T>(vals); selectionChanged(); }
ListMultipleSelection extends ListSelection<T> { public void setSelectedValues(final List<T> vals) { if (vals == null) throw new NullPointerException("value list is null"); for (T v : vals) if (!values.contains(v)) throw new IllegalArgumentException("value not contained in list of possible values\n possible items = "+this.getPossibleValues()); selected = new ArrayList<T>(vals); selectionChanged(); } }
ListMultipleSelection extends ListSelection<T> { public void setSelectedValues(final List<T> vals) { if (vals == null) throw new NullPointerException("value list is null"); for (T v : vals) if (!values.contains(v)) throw new IllegalArgumentException("value not contained in list of possible values\n possible items = "+this.getPossibleValues()); selected = new ArrayList<T>(vals); selectionChanged(); } ListMultipleSelection(final T ... values);  ListMultipleSelection(final List<T> values); }
ListMultipleSelection extends ListSelection<T> { public void setSelectedValues(final List<T> vals) { if (vals == null) throw new NullPointerException("value list is null"); for (T v : vals) if (!values.contains(v)) throw new IllegalArgumentException("value not contained in list of possible values\n possible items = "+this.getPossibleValues()); selected = new ArrayList<T>(vals); selectionChanged(); } ListMultipleSelection(final T ... values);  ListMultipleSelection(final List<T> values); List<T> getSelectedValues(); void setSelectedValues(final List<T> vals); }
ListMultipleSelection extends ListSelection<T> { public void setSelectedValues(final List<T> vals) { if (vals == null) throw new NullPointerException("value list is null"); for (T v : vals) if (!values.contains(v)) throw new IllegalArgumentException("value not contained in list of possible values\n possible items = "+this.getPossibleValues()); selected = new ArrayList<T>(vals); selectionChanged(); } ListMultipleSelection(final T ... values);  ListMultipleSelection(final List<T> values); List<T> getSelectedValues(); void setSelectedValues(final List<T> vals);  }