examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/ui/addressform/AddressFormViewModel.java
static ObservableList<String> createListWithNothingSelectedMarker(ObservableList<String> source) {
		final ObservableList<String> result = FXCollections.observableArrayList();
		result.add(NOTHING_SELECTED_MARKER);
		result.addAll(source);

		// for sure there are better solutions for this but it's sufficient for our demo
		source.addListener((ListChangeListener<String>) c -> {
			result.clear();
			result.add(NOTHING_SELECTED_MARKER);
			result.addAll(source);
		});
		return result;
	}
static ObservableList<String> createListWithNothingSelectedMarker(ObservableList<String> source) {
		final ObservableList<String> result = FXCollections.observableArrayList();
		result.add(NOTHING_SELECTED_MARKER);
		result.addAll(source);

		// for sure there are better solutions for this but it's sufficient for our demo
		source.addListener((ListChangeListener<String>) c -> {
			result.clear();
			result.add(NOTHING_SELECTED_MARKER);
			result.addAll(source);
		});
		return result;
	}
static ObservableList < String > createListWithNothingSelectedMarker ( ObservableList < String > source ) { final ObservableList < String > result = FXCollections . observableArrayList ( ) ; result . add ( NOTHING_SELECTED_MARKER ) ; result . addAll ( source ) ; // for sure there are better solutions for this but it's sufficient for our demo source . addListener ( ( ListChangeListener < String > ) c -> { result . clear ( ) ; result . add ( NOTHING_SELECTED_MARKER ) ; result . addAll ( source ) ; } ) ; return result ; }
Creates an observable list that always has
{@link #NOTHING_SELECTED_MARKER} as first element and the values of the
given observable list.
Creates an observable list that always has {