Top Description Fields Constructors Methods
org.jabref.gui.fieldeditors.optioneditors.mapbased

public abstract Class MapBasedEditorViewModel<T>

extends OptionEditorViewModel<T>
Class Inheritance
Known Direct Subclasses
org.jabref.gui.fieldeditors.optioneditors.mapbased.StringMapBasedEditorViewModel
Imports
java.util.Collection, javax.swing.undo.UndoManager, javafx.util.StringConverter, org.jabref.gui.autocompleter.SuggestionProvider, org.jabref.gui.fieldeditors.optioneditors.OptionEditorViewModel, org.jabref.logic.integrity.FieldCheckers, org.jabref.model.entry.field.Field, com.google.common.collect.BiMap, org.slf4j.Logger, .LoggerFactory

View model for a field editor that shows various options backed by a map.

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
public
MapBasedEditorViewModel(Field field, SuggestionProvider<?> suggestionProvider, FieldCheckers fieldCheckers, UndoManager undoManager)

Method Summary

Modifier and TypeMethod and Description
protected abstract BiMap<String, T>
public Collection<T>
public StringConverter<T>
getStringConverter()

Implements abstract org.jabref.gui.fieldeditors.optioneditors.OptionEditorViewModel.getStringConverter.

Converts the user input to a String used in BibTeX

protected T

Returns:

The value or null if the value could not be cast
getValueFromString
(String
The input value to convert
string
)

Converts a String value to the Type T.

Inherited from org.jabref.gui.fieldeditors.optioneditors.OptionEditorViewModel:
convertToDisplayText

Field Detail

LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

MapBasedEditorViewModelback to summary
public MapBasedEditorViewModel(Field field, SuggestionProvider<?> suggestionProvider, FieldCheckers fieldCheckers, UndoManager undoManager)

Method Detail

getItemMapback to summary
protected abstract BiMap<String, T> getItemMap()
getItemsback to summary
public Collection<T> getItems()

Implements abstract org.jabref.gui.fieldeditors.optioneditors.OptionEditorViewModel.getItems.

Doc from org.jabref.gui.fieldeditors.optioneditors.OptionEditorViewModel.getItems.

Returns all available items

Annotations
@Override
getStringConverterback to summary
public StringConverter<T> getStringConverter()

Implements abstract org.jabref.gui.fieldeditors.optioneditors.OptionEditorViewModel.getStringConverter.

Doc from org.jabref.gui.fieldeditors.optioneditors.OptionEditorViewModel.getStringConverter.

Converts the user input to a String used in BibTeX

Annotations
@Override
getValueFromStringback to summary
protected T getValueFromString(String string)

Converts a String value to the Type T. If the type cannot be directly cast to T, this method must be overridden in a subclass

Parameters
string:String

The input value to convert

Returns:T

The value or null if the value could not be cast

Annotations
@SuppressWarnings:unchecked