Verified Owner
Top Fields Constructors Methods
org.jabref.gui.fieldeditors.identifier

public abstract Class BaseIdentifierEditorViewModel<T extends Identifier>

extends AbstractEditorViewModel
Class Inheritance
Known Direct Subclasses
org.jabref.gui.fieldeditors.identifier.DoiIdentifierEditorViewModel, org.jabref.gui.fieldeditors.identifier.EprintIdentifierEditorViewModel, org.jabref.gui.fieldeditors.identifier.ISBNIdentifierEditorViewModel, org.jabref.gui.fieldeditors.identifier.ISSNIdentifierEditorViewModel, org.jabref.gui.fieldeditors.identifier.MathSciNetIdentifierEditorViewModel
Imports
java.io.IOException, java.util.Optional, javafx.beans.property.BooleanProperty, .ObjectProperty, .SimpleBooleanProperty, .SimpleObjectProperty, org.jabref.gui.DialogService, .StateManager, org.jabref.gui.autocompleter.SuggestionProvider, org.jabref.gui.desktop.os.NativeDesktop, org.jabref.gui.fieldeditors.AbstractEditorViewModel, org.jabref.gui.mergeentries.FetchAndMergeEntry, org.jabref.gui.preferences.GuiPreferences, org.jabref.logic.importer.FetcherClientException, .FetcherServerException, .IdFetcher, org.jabref.logic.importer.util.IdentifierParser, org.jabref.logic.integrity.FieldCheckers, org.jabref.logic.l10n.Localization, org.jabref.logic.undo.UndoManager, org.jabref.logic.util.TaskExecutor, org.jabref.model.entry.BibEntry, org.jabref.model.entry.field.Field, .FieldTextMapper, org.jabref.model.entry.identifier.Identifier, com.tobiasdiez.easybind.EasyBind, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
protected final BooleanProperty
protected final BooleanProperty
protected final BooleanProperty
protected final BooleanProperty
protected DialogService
protected final ObjectProperty<Optional<T>>
protected final BooleanProperty
protected IdentifierParser
protected BooleanProperty
private static final Logger
protected GuiPreferences
protected final StateManager
protected TaskExecutor
Inherited from org.jabref.gui.fieldeditors.AbstractEditorViewModel:
entryfieldtextundoManager

Constructor Summary

AccessConstructor and Description
public
BaseIdentifierEditorViewModel(Field field, SuggestionProvider<?> suggestionProvider, FieldCheckers fieldCheckers, DialogService dialogService, TaskExecutor taskExecutor, GuiPreferences preferences, UndoManager undoManager, StateManager stateManager)

Method Summary

Modifier and TypeMethod and Description
public void
public BooleanProperty
public BooleanProperty
public BooleanProperty
public BooleanProperty
protected final void
configure(boolean canFetchBibliographyInformationById, boolean canLookupIdentifier, boolean canShortenIdentifier)

Since it's not possible to perform the same actions on all identifiers, specific implementations can call the configure method to tell the actions they can perform and the actions they can't.

protected final void
configure(boolean canFetchBibliographyInformationById, boolean canLookupIdentifier, boolean canShortenIdentifier, boolean canSyncWithBrowser)

Overload adding canSyncWithBrowser, currently only used by the MathSciNet editor.

public void
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
getSyncWithBrowser()

Whether this identifier should currently be synced to the browser extension.

protected void
handleIdentifierFetchingError(Exception exception, org.jabref.logic.importer.IdFetcher<T> fetcher)

public BooleanProperty
public BooleanProperty
public void
public void
setSyncWithBrowser(boolean syncWithBrowser)

public void
protected Optional<T>
Inherited from org.jabref.gui.fieldeditors.AbstractEditorViewModel:
completegetFieldValidatortextProperty

Field Detail

canFetchBibliographyInformationByIdback to summary
protected final BooleanProperty canFetchBibliographyInformationById
canLookupIdentifierback to summary
protected final BooleanProperty canLookupIdentifier
canShortenIdentifierback to summary
protected final BooleanProperty canShortenIdentifier
canSyncWithBrowserback to summary
protected final BooleanProperty canSyncWithBrowser
dialogServiceback to summary
protected DialogService dialogService
identifierback to summary
protected final ObjectProperty<Optional<T>> identifier
identifierLookupInProgressback to summary
protected final BooleanProperty identifierLookupInProgress
identifierParserback to summary
protected IdentifierParser identifierParser
isInvalidIdentifierback to summary
protected BooleanProperty isInvalidIdentifier
LOGGERback to summary
private static final Logger LOGGER
preferencesback to summary
protected GuiPreferences preferences
stateManagerback to summary
protected final StateManager stateManager
taskExecutorback to summary
protected TaskExecutor taskExecutor

Constructor Detail

BaseIdentifierEditorViewModelback to summary
public BaseIdentifierEditorViewModel(Field field, SuggestionProvider<?> suggestionProvider, FieldCheckers fieldCheckers, DialogService dialogService, TaskExecutor taskExecutor, GuiPreferences preferences, UndoManager undoManager, StateManager stateManager)

Method Detail

bindToEntryback to summary
public void bindToEntry(BibEntry entry)

Overrides org.jabref.gui.fieldeditors.AbstractEditorViewModel.bindToEntry.

Annotations
@Override
canFetchBibliographyInformationByIdPropertyback to summary
public BooleanProperty canFetchBibliographyInformationByIdProperty()
canLookupIdentifierPropertyback to summary
public BooleanProperty canLookupIdentifierProperty()
canShortenIdentifierPropertyback to summary
public BooleanProperty canShortenIdentifierProperty()
canSyncWithBrowserPropertyback to summary
public BooleanProperty canSyncWithBrowserProperty()
configureback to summary
protected final void configure(boolean canFetchBibliographyInformationById, boolean canLookupIdentifier, boolean canShortenIdentifier)

Since it's not possible to perform the same actions on all identifiers, specific implementations can call the configure method to tell the actions they can perform and the actions they can't. Based on this configuration, the view will enable/disable or show/hide certain UI elements for certain identifier editors.

Note

This method MUST be called by all the implementation view models in their principal constructor

configureback to summary
protected final void configure(boolean canFetchBibliographyInformationById, boolean canLookupIdentifier, boolean canShortenIdentifier, boolean canSyncWithBrowser)

Overload adding canSyncWithBrowser, currently only used by the MathSciNet editor. Kept separate from the 3-arg overload so the far more common call sites don't all need a trailing false.

fetchBibliographyInformationback to summary
public void fetchBibliographyInformation(BibEntry bibEntry)
getCanFetchBibliographyInformationByIdback to summary
public boolean getCanFetchBibliographyInformationById()
getCanLookupIdentifierback to summary
public boolean getCanLookupIdentifier()
getCanShortenIdentifierback to summary
public boolean getCanShortenIdentifier()
getCanSyncWithBrowserback to summary
public boolean getCanSyncWithBrowser()
getIdentifierLookupInProgressback to summary
public boolean getIdentifierLookupInProgress()
getIdentifierLookupNotInProgressback to summary
public boolean getIdentifierLookupNotInProgress()
getIsInvalidIdentifierback to summary
public boolean getIsInvalidIdentifier()
getSyncWithBrowserback to summary
public boolean getSyncWithBrowser()

Whether this identifier should currently be synced to the browser extension. Only meaningful when getCanSyncWithBrowser() is true; overridden by the (currently only) editor that supports it.

handleIdentifierFetchingErrorback to summary
protected void handleIdentifierFetchingError(Exception exception, org.jabref.logic.importer.IdFetcher<T> fetcher)
identifierLookupInProgressPropertyback to summary
public BooleanProperty identifierLookupInProgressProperty()
isInvalidIdentifierPropertyback to summary
public BooleanProperty isInvalidIdentifierProperty()
lookupIdentifierback to summary
public void lookupIdentifier(BibEntry bibEntry)
setSyncWithBrowserback to summary
public void setSyncWithBrowser(boolean syncWithBrowser)
shortenIDback to summary
public void shortenID() throws UnsupportedOperationException
updateIdentifierback to summary
protected Optional<T> updateIdentifier()