Verified Owner
Top Description Fields Constructors Methods
org.jabref.gui.openoffice

public Class OOBibBase

extends Object
Class Inheritance
Imports
java.io.IOException, java.nio.file.Path, java.util.ArrayList, .Arrays, .List, .Objects, .Optional, java.util.function.Supplier, java.util.stream.Collectors, org.jabref.gui.DialogService, org.jabref.logic.JabRefException, org.jabref.logic.citationstyle.CSLStyleLoader, .CitationStyle, org.jabref.logic.l10n.Localization, org.jabref.logic.openoffice.OpenOfficePreferences, .ZoteroDocumentPreferences, org.jabref.logic.openoffice.action.EditInsert, .EditMerge, .EditSeparate, .ExportCited, .ManageCitations, .Update, org.jabref.logic.openoffice.frontend.OOFrontend, .RangeForOverlapCheck, org.jabref.logic.openoffice.oocsltext.BSTCitationOOAdapter, .BstUpdateBibliography, .CSLCitationOOAdapter, .CSLCitationType, .CSLUpdateBibliography, .MissingStyleDefinedCitationLabelException, org.jabref.logic.openoffice.style.BstStyle, .JStyle, .OOStyle, org.jabref.model.database.BibDatabase, .BibDatabaseContext, org.jabref.model.entry.BibEntry, .BibEntryTypesManager, org.jabref.model.openoffice.CitationEntry, org.jabref.model.openoffice.rangesort.FunctionalTextViewCursor, org.jabref.model.openoffice.style.CitationGroupId, .CitationType, org.jabref.model.openoffice.uno.CreationException, .NoDocumentException, .UnoCrossRef, .UnoCursor, .UnoRedlines, .UnoStyle, .UnoUndo, org.jabref.model.openoffice.util.OOResult, .OOVoidResult, com.sun.star.beans.IllegalTypeException, com.sun.star.beans.NotRemoveableException, com.sun.star.beans.PropertyVetoException, com.sun.star.comp.helper.BootstrapException, com.sun.star.container.NoSuchElementException, com.sun.star.lang.WrappedTargetException, com.sun.star.text.XTextCursor, com.sun.star.text.XTextDocument, com.sun.star.text.XTextRange, com.sun.star.uno.XComponentContext, org.slf4j.Logger, .LoggerFactory

Class for manipulating the Bibliography of the currently started document in OpenOffice.

Field Summary

Modifier and TypeField and Description
private final BibEntryTypesManager
private BSTCitationOOAdapter
private BstUpdateBibliography
private final com.sun.star.uno.XComponentContext
private final OOBibBaseConnect
private CSLCitationOOAdapter
private CSLUpdateBibliography
private final DialogService
private static final Logger
private final OpenOfficePreferences

Constructor Summary

AccessConstructor and Description
public
OOBibBase(Path loPath, DialogService dialogService, OpenOfficePreferences openOfficePreferences, BibEntryTypesManager bibEntryTypesManager)

Method Summary

Modifier and TypeMethod and Description
private org.jabref.model.openoffice.util.OOVoidResult<OOError>
checkCitationMarkersOutsidePendingDeletions(com.sun.star.text.XTextDocument doc, OOStyle style, OOFrontend frontend)

private static org.jabref.model.openoffice.util.OOVoidResult<OOError>
checkRangeOverlaps(com.sun.star.text.XTextDocument doc, OOFrontend frontend)

private static org.jabref.model.openoffice.util.OOVoidResult<OOError>
checkRangeOverlapsWithCursor(com.sun.star.text.XTextDocument doc, OOFrontend frontend, OOStyle style)

private org.jabref.model.openoffice.util.OOVoidResult<OOError>
checkStyleExistsInTheDocument(String familyName, String styleName, com.sun.star.text.XTextDocument doc, String labelInJstyleFile, String pathToStyleFile)

public org.jabref.model.openoffice.util.OOVoidResult<OOError>
checkStylesExistInTheDocument(JStyle jStyle, com.sun.star.text.XTextDocument doc)

private void
clearCitationAdapters()

Clear all document-bound helpers after connection loss or before switching to another document.

pack-priv org.jabref.model.openoffice.util.OOVoidResult<OOError>
collectResults(String errorTitle, List<org.jabref.model.openoffice.util.OOVoidResult<OOError>> results)

pack-priv org.jabref.model.openoffice.util.OOVoidResult<OOError>
public void
dispose()

dispose in SE is usually treated as a lifecycle hook which means that the concerned object is no longer to be used.

private org.jabref.model.openoffice.util.OOResult<GenerateDatabaseResult, JabRefException>
private org.jabref.model.openoffice.util.OOResult<GenerateDatabaseResult, JabRefException>
public Optional<BibDatabase>
exportCitedHelper(List<BibDatabase> databases, OOStyle style, boolean
If there are some unresolved keys, shall we return an otherwise nonempty result, or Optional.empty()?
returnPartialResult
)

GUI action for "Export cited"

Does not refresh the bibliography.

public Optional<String>
getCurrentDocumentTitle()

The title of the current document, or Optional.empty()

pack-priv org.jabref.model.openoffice.util.OOResult<OOFrontend, OOError>
getFrontend(com.sun.star.text.XTextDocument doc)

pack-priv org.jabref.model.openoffice.util.OOResult<FunctionalTextViewCursor, OOError>
getFunctionalTextViewCursor(com.sun.star.text.XTextDocument doc, String errorTitle)

This may move the view cursor.

pack-priv org.jabref.model.openoffice.util.OOResult<com.sun.star.text.XTextCursor, OOError>
getUserCursorForTextInsertion(com.sun.star.text.XTextDocument doc, String errorTitle)

Get the cursor positioned by the user for inserting text.

public org.jabref.model.openoffice.util.OOResult<com.sun.star.text.XTextDocument, OOError>
getXTextDocument()

Either return an XTextDocument or return JabRefException.

public void
guiActionApplyCitationEntries(List<CitationEntry> citationEntries)

Apply editable parts of citationEntries to the document: store pageInfo.

public Optional<List<CitationEntry>>
public void
guiActionInsertEntry(List<BibEntry>
The entries to cite.
entries
,
BibDatabaseContext
The database the entries belong to (all of them). Used when creating the citation mark.
bibDatabaseContext
,
List<BibDatabase>
The databases selected for citation lookup in this action.
selectedDatabases
,
OOStyle
The bibliography style we are using.
style
,
CitationType
Indicates whether it is an in-text citation, a citation in parenthesis or an invisible citation.
citationType
,
String
A single page-info for these entries. Attributed to the last entry.
pageInfo
,
Optional<SyncOptions>
Indicates whether in-text citations should be refreshed in the document. Optional.empty() indicates no refresh. Otherwise, provides options for refreshing the reference list.
syncOptions
)

Creates a citation group from entries at the cursor.

public void
guiActionMergeCitationGroups(List<BibDatabase> databases, OOStyle style)

GUI action "Merge citations"

public void
guiActionSelectDocument(boolean autoSelectForSingle)

public void
guiActionSeparateCitations(List<BibDatabase> databases, OOStyle style)

GUI action "Separate citations".

public void
guiActionUpdateDocument(List<BibDatabase>
Must have at least one.
databases
,
OOStyle
Style.
style
)

GUI action, refreshes citation markers and bibliography.

pack-priv org.jabref.model.openoffice.util.OOResult<Optional<CitationStyle>, OOError>
private org.jabref.model.openoffice.util.OOResult<Optional<CitationStyle>, OOError>
inferCslStyleFromDocument(com.sun.star.text.XTextDocument doc)

private void
initializeCitationAdapter(com.sun.star.text.XTextDocument doc)

Adapter lifecycle is tied to the currently selected document.

private org.jabref.model.openoffice.util.OOVoidResult<OOError>
insertBstCitation(List<BibEntry> entries, com.sun.star.text.XTextDocument doc, BstStyle bstStyle, BibDatabaseContext bibDatabaseContext, org.jabref.model.openoffice.util.OOResult<com.sun.star.text.XTextCursor, OOError> cursor)

Helper method for guiActionInsertEntry - handles BST citation insertion.

public org.jabref.model.openoffice.util.OOVoidResult<OOError>
insertCSLCitation(List<BibEntry>
The entries to cite.
entries
,
com.sun.star.text.XTextDocument doc, CitationType
Indicates whether it is an in-text citation, a citation in parenthesis or an invisible citation.
citationType
,
CitationStyle
Indicates style, name and path of citation
citationStyle
,
BibDatabaseContext
The database the entries belong to. Used when creating the citation mark.
currentEntryContext
,
List<BibDatabase>
The databases selected for resolving existing CSL citations during this action.
selectedDatabases
,
org.jabref.model.openoffice.util.OOResult<com.sun.star.text.XTextCursor, OOError> cursor, Optional<SyncOptions>
Indicates whether in-text citations should be refreshed in the document. Optional.empty() indicates no refresh. Otherwise, provides options for refreshing the reference list.
syncOptions
)

Helper method for guiActionInsertEntry.

public org.jabref.model.openoffice.util.OOVoidResult<OOError>
insertJStyleCitation(List<BibEntry>
The entries to cite.
entries
,
com.sun.star.text.XTextDocument doc, CitationType
Indicates whether it is an in-text citation, a citation in parentheses or an invisible citation.
citationType
,
JStyle
Indicates citation formating in JStyle
jStyle
,
org.jabref.model.openoffice.util.OOResult<OOFrontend, OOError> frontend, org.jabref.model.openoffice.util.OOResult<com.sun.star.text.XTextCursor, OOError> cursor, BibDatabaseContext
The database the entries belong to (all of them). Used when creating the citation mark.
bibDatabaseContext
,
Optional<SyncOptions>
Indicates whether in-text citations should be refreshed in the document. Optional.empty() indicates no refresh. Otherwise, provides options for refreshing the reference list.
syncOptions
,
String
A single page-info for these entries. Attributed to the last entry.
pageInfo
,
org.jabref.model.openoffice.util.OOResult<FunctionalTextViewCursor, OOError> fcursor)

Helper method for guiActionInsertEntry Throws PropertyVetoException, WrappedTargetException, IllegalTypeException, NotRemoveableException, CreationException, NoDocumentException Exceptions caught by guiActionInsertEntry

public boolean
isConnectedToDocument()

A simple test for document availability.

public boolean
isDocumentConnectionMissing()

Returns: true if we are connected to a document

pack-priv org.jabref.model.openoffice.util.OOVoidResult<OOError>
pack-priv void
pack-priv org.jabref.model.openoffice.util.OOVoidResult<OOError>
private <T> T
supplyWithTrackChangesSuspended(com.sun.star.text.XTextDocument doc, Supplier<T> action)

Run a marker-rewriting action with change recording suspended.

pack-priv boolean
testDialog(org.jabref.model.openoffice.util.OOVoidResult<OOError> res)

pack-priv boolean
testDialog(String errorTitle, org.jabref.model.openoffice.util.OOVoidResult<OOError> res)

pack-priv final boolean
testDialog(String errorTitle, org.jabref.model.openoffice.util.OOVoidResult<OOError>... results)

private org.jabref.model.openoffice.util.OOVoidResult<OOError>
updateBstBibliography(List<BibDatabase>
Must have at least one.
databases
,
BstStyle
BST style to update the bibliography with.
bstStyle
,
com.sun.star.text.XTextDocument
Text document.
doc
,
org.jabref.model.openoffice.util.OOResult<FunctionalTextViewCursor, OOError>
Used to synchronize document.
fcursor
,
String
Error message for user.
errorTitle
)

Helper method for guiActionUpdateDocument - refreshes a BST bibliography.

private org.jabref.model.openoffice.util.OOVoidResult<OOError>
updateCSLBibliography(List<BibDatabase>
Must have at least one.
databases
,
CitationStyle
Citation style to update bibliography with.
citationStyle
,
com.sun.star.text.XTextDocument
Text document.
doc
,
org.jabref.model.openoffice.util.OOResult<FunctionalTextViewCursor, OOError>
Used to synchronize document.
fcursor
,
String
Error message for user.
errorTitle
)

Helper method for guiActionUpdateDocument, refreshes a CSL bibliography.

pack-priv static org.jabref.model.openoffice.util.OOVoidResult<OOError>
updateCSLBibliography(DialogService dialogService, List<BibDatabase> databases, CitationStyle citationStyle, com.sun.star.text.XTextDocument doc, org.jabref.model.openoffice.util.OOResult<FunctionalTextViewCursor, OOError> fcursor, String errorTitle, CSLCitationOOAdapter cslCitationOOAdapter, CSLUpdateBibliography cslUpdateBibliography)

private org.jabref.model.openoffice.util.OOVoidResult<OOError>
updateJStyleBibliography(List<BibDatabase>
Must have at least one.
databases
,
JStyle
Indicates citation formating in JStyle.
jStyle
,
com.sun.star.text.XTextDocument
Text document.
doc
,
OOFrontend frontend, org.jabref.model.openoffice.util.OOResult<FunctionalTextViewCursor, OOError> fcursor, String
Error message for user.
errorTitle
)

Helper method for guiActionUpdateDocument, refreshes a JStyle bibliography.

pack-priv org.jabref.model.openoffice.util.OOVoidResult<OOError>
pack-priv static org.jabref.model.openoffice.util.OOVoidResult<OOError>
writeDocumentCslStyle(com.sun.star.text.XTextDocument doc, CitationStyle citationStyle)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bibEntryTypesManagerback to summary
private final BibEntryTypesManager bibEntryTypesManager
bstCitationOOAdapterback to summary
private BSTCitationOOAdapter bstCitationOOAdapter
bstUpdateBibliographyback to summary
private BstUpdateBibliography bstUpdateBibliography
componentContextback to summary
private final com.sun.star.uno.XComponentContext componentContext
connectionback to summary
private final OOBibBaseConnect connection
cslCitationOOAdapterback to summary
private CSLCitationOOAdapter cslCitationOOAdapter
cslUpdateBibliographyback to summary
private CSLUpdateBibliography cslUpdateBibliography
dialogServiceback to summary
private final DialogService dialogService
LOGGERback to summary
private static final Logger LOGGER
openOfficePreferencesback to summary
private final OpenOfficePreferences openOfficePreferences

Constructor Detail

OOBibBaseback to summary
public OOBibBase(Path loPath, DialogService dialogService, OpenOfficePreferences openOfficePreferences, BibEntryTypesManager bibEntryTypesManager) throws BootstrapException, org.jabref.model.openoffice.uno.CreationException, IOException, InterruptedException

Method Detail

checkCitationMarkersOutsidePendingDeletionsback to summary
private org.jabref.model.openoffice.util.OOVoidResult<OOError> checkCitationMarkersOutsidePendingDeletions(com.sun.star.text.XTextDocument doc, OOStyle style, OOFrontend frontend)
checkRangeOverlapsback to summary
private static org.jabref.model.openoffice.util.OOVoidResult<OOError> checkRangeOverlaps(com.sun.star.text.XTextDocument doc, OOFrontend frontend)
checkRangeOverlapsWithCursorback to summary
private static org.jabref.model.openoffice.util.OOVoidResult<OOError> checkRangeOverlapsWithCursor(com.sun.star.text.XTextDocument doc, OOFrontend frontend, OOStyle style)
checkStyleExistsInTheDocumentback to summary
private org.jabref.model.openoffice.util.OOVoidResult<OOError> checkStyleExistsInTheDocument(String familyName, String styleName, com.sun.star.text.XTextDocument doc, String labelInJstyleFile, String pathToStyleFile) throws com.sun.star.lang.WrappedTargetException
checkStylesExistInTheDocumentback to summary
public org.jabref.model.openoffice.util.OOVoidResult<OOError> checkStylesExistInTheDocument(JStyle jStyle, com.sun.star.text.XTextDocument doc)
clearCitationAdaptersback to summary
private void clearCitationAdapters()

Clear all document-bound helpers after connection loss or before switching to another document.

collectResultsback to summary
pack-priv org.jabref.model.openoffice.util.OOVoidResult<OOError> collectResults(String errorTitle, List<org.jabref.model.openoffice.util.OOVoidResult<OOError>> results)
databaseIsRequiredback to summary
pack-priv org.jabref.model.openoffice.util.OOVoidResult<OOError> databaseIsRequired(List<BibDatabase> databases, Supplier<OOError> fun)
disposeback to summary
public void dispose()

dispose in SE is usually treated as a lifecycle hook which means that the concerned object is no longer to be used.

It is arguable that this wrapper logically adds no extra functionality over clearCitationAdapters (the private helper), but it is to maintain a semantic split when called from OpenOfficePanel externally - meaning clear related resources without knowing "what".

When called internally, we use the private helper as it does not come with the meaning mentioned above, as we are about to reuse the same ooBase object.

exportCitedForBSTback to summary
private org.jabref.model.openoffice.util.OOResult<GenerateDatabaseResult, JabRefException> exportCitedForBST(List<BibDatabase> databases)
exportCitedForCSLback to summary
private org.jabref.model.openoffice.util.OOResult<GenerateDatabaseResult, JabRefException> exportCitedForCSL(List<BibDatabase> databases)
exportCitedHelperback to summary
public Optional<BibDatabase> exportCitedHelper(List<BibDatabase> databases, OOStyle style, boolean returnPartialResult)

GUI action for "Export cited"

Does not refresh the bibliography.

Parameters
returnPartialResult:boolean

If there are some unresolved keys, shall we return an otherwise nonempty result, or Optional.empty()?

getCurrentDocumentTitleback to summary
public Optional<String> getCurrentDocumentTitle()

The title of the current document, or Optional.empty()

getFrontendback to summary
pack-priv org.jabref.model.openoffice.util.OOResult<OOFrontend, OOError> getFrontend(com.sun.star.text.XTextDocument doc)
getFunctionalTextViewCursorback to summary
pack-priv org.jabref.model.openoffice.util.OOResult<FunctionalTextViewCursor, OOError> getFunctionalTextViewCursor(com.sun.star.text.XTextDocument doc, String errorTitle)

This may move the view cursor.

getUserCursorForTextInsertionback to summary
pack-priv org.jabref.model.openoffice.util.OOResult<com.sun.star.text.XTextCursor, OOError> getUserCursorForTextInsertion(com.sun.star.text.XTextDocument doc, String errorTitle)

Get the cursor positioned by the user for inserting text.

getXTextDocumentback to summary
public org.jabref.model.openoffice.util.OOResult<com.sun.star.text.XTextDocument, OOError> getXTextDocument()

Either return an XTextDocument or return JabRefException.

guiActionApplyCitationEntriesback to summary
public void guiActionApplyCitationEntries(List<CitationEntry> citationEntries)

Apply editable parts of citationEntries to the document: store pageInfo.

Does not change presentation.

Note

we use no undo context here, because only DocumentConnection.setUserDefinedStringPropertyValue() is called, and Undo in LO will not undo that.

GUI: "Manage citations" dialog "OK" button. Called from: ManageCitationsDialogViewModel.storeSettings

Currently the only editable part is pageInfo.

Since the only call to applyCitationEntries() only changes pageInfo w.r.t those returned by getCitationEntries(), we can do with the following restrictions:

  • Missing pageInfo means no action.
  • Missing CitationEntry means no action (no attempt to remove citation from the text).
guiActionGetCitationEntriesback to summary
public Optional<List<CitationEntry>> guiActionGetCitationEntries()
guiActionInsertEntryback to summary
public void guiActionInsertEntry(List<BibEntry> entries, BibDatabaseContext bibDatabaseContext, List<BibDatabase> selectedDatabases, OOStyle style, CitationType citationType, String pageInfo, Optional<SyncOptions> syncOptions)

Creates a citation group from entries at the cursor.

Uses LO undo context "Insert citation".

Note

Undo does not remove or reestablish custom properties.

Consistency: for each entry in entries: looking it up in syncOptions.get().databases (if present) should yield database.

Parameters
entries:List<BibEntry>

The entries to cite.

bibDatabaseContext:BibDatabaseContext

The database the entries belong to (all of them). Used when creating the citation mark.

selectedDatabases:List<BibDatabase>

The databases selected for citation lookup in this action.

style:OOStyle

The bibliography style we are using.

citationType:CitationType

Indicates whether it is an in-text citation, a citation in parenthesis or an invisible citation.

pageInfo:String

A single page-info for these entries. Attributed to the last entry.

syncOptions:Optional<SyncOptions>

Indicates whether in-text citations should be refreshed in the document. Optional.empty() indicates no refresh. Otherwise, provides options for refreshing the reference list.

guiActionMergeCitationGroupsback to summary
public void guiActionMergeCitationGroups(List<BibDatabase> databases, OOStyle style)

GUI action "Merge citations"

guiActionSelectDocumentback to summary
public void guiActionSelectDocument(boolean autoSelectForSingle) throws com.sun.star.lang.WrappedTargetException, com.sun.star.container.NoSuchElementException
guiActionSeparateCitationsback to summary
public void guiActionSeparateCitations(List<BibDatabase> databases, OOStyle style)

GUI action "Separate citations".

Do the opposite of MergeCitationGroups. Combined markers are split, with a space inserted between.

guiActionUpdateDocumentback to summary
public void guiActionUpdateDocument(List<BibDatabase> databases, OOStyle style)

GUI action, refreshes citation markers and bibliography.

Parameters
databases:List<BibDatabase>

Must have at least one.

style:OOStyle

Style.

inferCslStyleFromDocumentback to summary
pack-priv org.jabref.model.openoffice.util.OOResult<Optional<CitationStyle>, OOError> inferCslStyleFromDocument()
inferCslStyleFromDocumentback to summary
private org.jabref.model.openoffice.util.OOResult<Optional<CitationStyle>, OOError> inferCslStyleFromDocument(com.sun.star.text.XTextDocument doc)
initializeCitationAdapterback to summary
private void initializeCitationAdapter(com.sun.star.text.XTextDocument doc) throws com.sun.star.lang.WrappedTargetException, com.sun.star.container.NoSuchElementException

Adapter lifecycle is tied to the currently selected document. Keep creation here so cite/export/ bibliography actions only ever use adapters that were initialized as part of document selection.

insertBstCitationback to summary
private org.jabref.model.openoffice.util.OOVoidResult<OOError> insertBstCitation(List<BibEntry> entries, com.sun.star.text.XTextDocument doc, BstStyle bstStyle, BibDatabaseContext bibDatabaseContext, org.jabref.model.openoffice.util.OOResult<com.sun.star.text.XTextCursor, OOError> cursor)

Helper method for guiActionInsertEntry - handles BST citation insertion.

insertCSLCitationback to summary
public org.jabref.model.openoffice.util.OOVoidResult<OOError> insertCSLCitation(List<BibEntry> entries, com.sun.star.text.XTextDocument doc, CitationType citationType, CitationStyle citationStyle, BibDatabaseContext currentEntryContext, List<BibDatabase> selectedDatabases, org.jabref.model.openoffice.util.OOResult<com.sun.star.text.XTextCursor, OOError> cursor, Optional<SyncOptions> syncOptions)

Helper method for guiActionInsertEntry. Handles CSL citation insertion Throws CreationException, com.sun.star.uno.Exception Caught by guiActionInsertEntry

Parameters
entries:List<BibEntry>

The entries to cite.

citationType:CitationType

Indicates whether it is an in-text citation, a citation in parenthesis or an invisible citation.

citationStyle:CitationStyle

Indicates style, name and path of citation

currentEntryContext:BibDatabaseContext

The database the entries belong to. Used when creating the citation mark.

selectedDatabases:List<BibDatabase>

The databases selected for resolving existing CSL citations during this action.

syncOptions:Optional<SyncOptions>

Indicates whether in-text citations should be refreshed in the document. Optional.empty() indicates no refresh. Otherwise, provides options for refreshing the reference list.

insertJStyleCitationback to summary
public org.jabref.model.openoffice.util.OOVoidResult<OOError> insertJStyleCitation(List<BibEntry> entries, com.sun.star.text.XTextDocument doc, CitationType citationType, JStyle jStyle, org.jabref.model.openoffice.util.OOResult<OOFrontend, OOError> frontend, org.jabref.model.openoffice.util.OOResult<com.sun.star.text.XTextCursor, OOError> cursor, BibDatabaseContext bibDatabaseContext, Optional<SyncOptions> syncOptions, String pageInfo, org.jabref.model.openoffice.util.OOResult<FunctionalTextViewCursor, OOError> fcursor)

Helper method for guiActionInsertEntry Throws PropertyVetoException, WrappedTargetException, IllegalTypeException, NotRemoveableException, CreationException, NoDocumentException Exceptions caught by guiActionInsertEntry

Parameters
entries:List<BibEntry>

The entries to cite.

citationType:CitationType

Indicates whether it is an in-text citation, a citation in parentheses or an invisible citation.

jStyle:JStyle

Indicates citation formating in JStyle

bibDatabaseContext:BibDatabaseContext

The database the entries belong to (all of them). Used when creating the citation mark.

syncOptions:Optional<SyncOptions>

Indicates whether in-text citations should be refreshed in the document. Optional.empty() indicates no refresh. Otherwise, provides options for refreshing the reference list.

pageInfo:String

A single page-info for these entries. Attributed to the last entry.

isConnectedToDocumentback to summary
public boolean isConnectedToDocument()

A simple test for document availability.

See also isDocumentConnectionMissing for a test actually attempting to use the connection.

isDocumentConnectionMissingback to summary
public boolean isDocumentConnectionMissing()
Returns:boolean

true if we are connected to a document

selectedBibEntryIsRequiredback to summary
pack-priv org.jabref.model.openoffice.util.OOVoidResult<OOError> selectedBibEntryIsRequired(List<BibEntry> entries, Supplier<OOError> fun)
showDialogback to summary
pack-priv void showDialog(OOError err)
styleIsRequiredback to summary
pack-priv org.jabref.model.openoffice.util.OOVoidResult<OOError> styleIsRequired(OOStyle style)
supplyWithTrackChangesSuspendedback to summary
private <T> T supplyWithTrackChangesSuspended(com.sun.star.text.XTextDocument doc, Supplier<T> action)

Run a marker-rewriting action with change recording suspended.

This prevents duplicated citations when Writer's change recording is enabled: deleting the old marker would otherwise only mark it as deleted, leaving old and new marker side by side.

testDialogback to summary
pack-priv boolean testDialog(org.jabref.model.openoffice.util.OOVoidResult<OOError> res)
testDialogback to summary
pack-priv boolean testDialog(String errorTitle, org.jabref.model.openoffice.util.OOVoidResult<OOError> res)
testDialogback to summary
pack-priv final boolean testDialog(String errorTitle, org.jabref.model.openoffice.util.OOVoidResult<OOError>... results)
Annotations
@SafeVarargs
updateBstBibliographyback to summary
private org.jabref.model.openoffice.util.OOVoidResult<OOError> updateBstBibliography(List<BibDatabase> databases, BstStyle bstStyle, com.sun.star.text.XTextDocument doc, org.jabref.model.openoffice.util.OOResult<FunctionalTextViewCursor, OOError> fcursor, String errorTitle)

Helper method for guiActionUpdateDocument - refreshes a BST bibliography.

Parameters
databases:List<BibDatabase>

Must have at least one.

bstStyle:BstStyle

BST style to update the bibliography with.

doc:com.sun.star.text.XTextDocument

Text document.

fcursor:org.jabref.model.openoffice.util.OOResult<FunctionalTextViewCursor, OOError>

Used to synchronize document.

errorTitle:String

Error message for user.

updateCSLBibliographyback to summary
private org.jabref.model.openoffice.util.OOVoidResult<OOError> updateCSLBibliography(List<BibDatabase> databases, CitationStyle citationStyle, com.sun.star.text.XTextDocument doc, org.jabref.model.openoffice.util.OOResult<FunctionalTextViewCursor, OOError> fcursor, String errorTitle)

Helper method for guiActionUpdateDocument, refreshes a CSL bibliography.

Parameters
databases:List<BibDatabase>

Must have at least one.

citationStyle:CitationStyle

Citation style to update bibliography with.

doc:com.sun.star.text.XTextDocument

Text document.

fcursor:org.jabref.model.openoffice.util.OOResult<FunctionalTextViewCursor, OOError>

Used to synchronize document.

errorTitle:String

Error message for user.

updateCSLBibliographyback to summary
pack-priv static org.jabref.model.openoffice.util.OOVoidResult<OOError> updateCSLBibliography(DialogService dialogService, List<BibDatabase> databases, CitationStyle citationStyle, com.sun.star.text.XTextDocument doc, org.jabref.model.openoffice.util.OOResult<FunctionalTextViewCursor, OOError> fcursor, String errorTitle, CSLCitationOOAdapter cslCitationOOAdapter, CSLUpdateBibliography cslUpdateBibliography)
updateJStyleBibliographyback to summary
private org.jabref.model.openoffice.util.OOVoidResult<OOError> updateJStyleBibliography(List<BibDatabase> databases, JStyle jStyle, com.sun.star.text.XTextDocument doc, OOFrontend frontend, org.jabref.model.openoffice.util.OOResult<FunctionalTextViewCursor, OOError> fcursor, String errorTitle)

Helper method for guiActionUpdateDocument, refreshes a JStyle bibliography.

Parameters
databases:List<BibDatabase>

Must have at least one.

jStyle:JStyle

Indicates citation formating in JStyle.

doc:com.sun.star.text.XTextDocument

Text document.

errorTitle:String

Error message for user.

writeDocumentCslStyleback to summary
pack-priv org.jabref.model.openoffice.util.OOVoidResult<OOError> writeDocumentCslStyle(CitationStyle citationStyle)
writeDocumentCslStyleback to summary
pack-priv static org.jabref.model.openoffice.util.OOVoidResult<OOError> writeDocumentCslStyle(com.sun.star.text.XTextDocument doc, CitationStyle citationStyle)