@Override
    public Stream<Item> fieldsFor(T document) {
        final String currentValue = document.getTypeMapper().orElse(null);
        final Class<?> type = document.findDatabaseType();
        
        final Map<String, String> mapping = MapStream.fromStream(
            typeMappers.mapFrom(type).filter(TypeMapper::isToolApplicable),
            TypeMapper::getLabel,
            tm -> tm.getClass().getName()
        ).toSortedMap();
        
        final ObservableList<String> alternatives = FXCollections.observableList(
            new ArrayList<>(mapping.keySet())
        );
        alternatives.add(0, IDENTITY_MAPPER);
        
        //Create a binding that will convert the ChoiceBox's value to a valid
        //value for the document.typeMapperProperty()
        StringBinding binding = Bindings.createStringBinding(() -> {
            if (outputValue.isEmpty().get() || outputValue.get().equals(IDENTITY_MAPPER)) {
                return null;
            } else {
                return mapping.get(outputValue.get());
            }
        }, outputValue);
        document.typeMapperProperty().bind(binding);
        
        outputValue.set( 
            currentValue != null
            ? MapStream.of(mapping)
                .filterValue(currentValue::equals)
                .keys()
                .findAny()
                .orElseThrow(() -> new RuntimeException(
                    "Could not find requested value '" + currentValue + "' in mapping."
                )) 
            : null );
        
        return Stream.of(new ChoiceBoxItem<String>(
                "JDBC Type to Java",
                outputValue,
                alternatives,
                "The class that will be used to map types between the database and the generated code."
            )
        );
    }
@param <T>  the document type

@author  Simon Jonasson
@since   3.0.0
tool-parent/tool-propertyeditor/src/main/java/com/speedment/tool/propertyeditor/editor/TypeMapperPropertyEditor.java