Top Fields Constructors Methods
org.jabref.gui.libraryproperties.contentselectors

public Class ContentSelectorViewModel

extends Object
implements PropertiesTabViewModel
Class Inheritance
All Implemented Interfaces
org.jabref.gui.libraryproperties.PropertiesTabViewModel
Imports
java.util.ArrayList, .Comparator, .HashMap, .HashSet, .List, .Map, .Set, javafx.beans.binding.Bindings, .BooleanBinding, javafx.beans.property.ListProperty, .ObjectProperty, .SimpleListProperty, .SimpleObjectProperty, .SimpleStringProperty, .StringProperty, javafx.collections.FXCollections, org.jabref.gui.DialogService, org.jabref.gui.libraryproperties.PropertiesTabViewModel, org.jabref.gui.util.FieldsUtil, org.jabref.logic.l10n.Localization, org.jabref.model.database.BibDatabaseContext, org.jabref.model.entry.field.Field, .FieldFactory, org.jabref.model.metadata.ContentSelector, .ContentSelectors, .MetaData

Field Summary

Modifier and TypeField and Description
private final DialogService
private Map<Field, List<String>>
private final ListProperty<Field>
private final ListProperty<String>
private final MetaData
private final ObjectProperty<Field>
private final StringProperty

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
addFieldIfUnique(Field fieldToAdd)

private void
addKeywordIfUnique(Field field, String keywordToAdd)

private HashSet<String>
asHashSet(List<String> listToConvert)

private List<Field>
determineFieldsToRemove()

Determines the list of fields to remove in case a non-default map:

  • Fields that are not in the new list of fields and
  • >all default fields that have no associated keywords
public ListProperty<Field>
public ListProperty<String>
public BooleanBinding
public BooleanBinding
pack-priv BooleanBinding
private boolean
pack-priv void
populateKeywords(Field selectedField)

private void
removeFieldName(Field fieldToRemove)

private void
removeKeyword(Field field, String keywordToRemove)

public ObjectProperty<Field>
pack-priv StringProperty
public void
pack-priv void
pack-priv void
pack-priv void
pack-priv void
public void
private void
updateMetaDataContentSelector(List<Field> existingFields, Field field, List<String> keywords)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dialogServiceback to summary
private final DialogService dialogService
fieldKeywordsMapback to summary
private Map<Field, List<String>> fieldKeywordsMap
fieldsback to summary
private final ListProperty<Field> fields
keywordsback to summary
private final ListProperty<String> keywords
metaDataback to summary
private final MetaData metaData
selectedFieldback to summary
private final ObjectProperty<Field> selectedField
selectedKeywordback to summary
private final StringProperty selectedKeyword

Constructor Detail

ContentSelectorViewModelback to summary
pack-priv ContentSelectorViewModel(BibDatabaseContext databaseContext, DialogService dialogService)

Method Detail

addFieldIfUniqueback to summary
private void addFieldIfUnique(Field fieldToAdd)
addKeywordIfUniqueback to summary
private void addKeywordIfUnique(Field field, String keywordToAdd)
asHashSetback to summary
private HashSet<String> asHashSet(List<String> listToConvert)
determineFieldsToRemoveback to summary
private List<Field> determineFieldsToRemove()

Determines the list of fields to remove in case a non-default map:

  • Fields that are not in the new list of fields and
  • >all default fields that have no associated keywords
getFieldNamesBackingListback to summary
public ListProperty<Field> getFieldNamesBackingList()
getKeywordsBackingListback to summary
public ListProperty<String> getKeywordsBackingList()
isFieldNameListEmptyback to summary
public BooleanBinding isFieldNameListEmpty()
isNoFieldNameSelectedback to summary
public BooleanBinding isNoFieldNameSelected()
isNoKeywordSelectedback to summary
pack-priv BooleanBinding isNoKeywordSelected()
keywordsHaveChangedback to summary
private boolean keywordsHaveChanged(Field field, List<String> keywords)
populateKeywordsback to summary
pack-priv void populateKeywords(Field selectedField)
removeFieldNameback to summary
private void removeFieldName(Field fieldToRemove)
removeKeywordback to summary
private void removeKeyword(Field field, String keywordToRemove)
selectedFieldPropertyback to summary
public ObjectProperty<Field> selectedFieldProperty()
selectedKeywordPropertyback to summary
pack-priv StringProperty selectedKeywordProperty()
setValuesback to summary
public void setValues()

Implements org.jabref.gui.libraryproperties.PropertiesTabViewModel.setValues.

Annotations
@Override
showInputFieldNameDialogback to summary
pack-priv void showInputFieldNameDialog()
showInputKeywordDialogback to summary
pack-priv void showInputKeywordDialog(Field selectedField)
showRemoveFieldNameConfirmationDialogback to summary
pack-priv void showRemoveFieldNameConfirmationDialog(Field fieldToRemove)
showRemoveKeywordConfirmationDialogback to summary
pack-priv void showRemoveKeywordConfirmationDialog(Field field, String keywordToRemove)
storeSettingsback to summary
public void storeSettings()

Implements org.jabref.gui.libraryproperties.PropertiesTabViewModel.storeSettings.

Annotations
@Override
updateMetaDataContentSelectorback to summary
private void updateMetaDataContentSelector(List<Field> existingFields, Field field, List<String> keywords)