| | |
| | | |
| | | if (result.isSuccess()) { |
| | | // Set the new property value(s). |
| | | Collection<T> newValues = result.getValues(); |
| | | Collection<T> values = result.getValues(); |
| | | // Both newValues and oldValues sets need to use the PropertyDefinition |
| | | // as their comparator. Constructing a TreeSet<T> directly with the |
| | | // values collection will fail if the values are e.g. InetAddresses. |
| | | SortedSet<T> newValues = new TreeSet<T>(d); |
| | | newValues.addAll(values); |
| | | SortedSet<T> oldValues = new TreeSet<T>(mo.getPropertyValues(d)); |
| | | mo.setPropertyValues(d, newValues); |
| | | if (newValues.size() > 0) |
| | | mo.setPropertyValues(d, values); |
| | | if (values.size() > 0) |
| | | { |
| | | isLastChoiceReset = false; |
| | | } |
| | |
| | | // There are no newValues when we do a reset. |
| | | isLastChoiceReset = true; |
| | | } |
| | | registerModification(d, new TreeSet<T>(newValues), oldValues); |
| | | registerModification(d, newValues, oldValues); |
| | | app.println(); |
| | | app.pressReturnToContinue(); |
| | | return MenuResult.success(false); |