Verified Owner
Top Description Fields Constructors Methods
org.jabref.logic.openoffice.oocsltext

public Class BSTReferenceMarkManager

extends Object
Class Inheritance
Imports
java.util.ArrayList, .HashMap, .LinkedHashMap, .List, .Map, .Optional, java.util.regex.Matcher, .Pattern, java.util.stream.Collectors, org.jabref.logic.openoffice.JabRefReferenceMark, org.jabref.model.entry.BibEntry, org.jabref.model.openoffice.DocumentAnnotation, org.jabref.model.openoffice.ootext.OOText, .OOTextIntoOO, org.jabref.model.openoffice.rangesort.RangeSort, .RangeSortEntry, org.jabref.model.openoffice.uno.CreationException, .UnoDispatch, .UnoReferenceMark, .UnoTextRange, com.sun.star.container.NoSuchElementException, com.sun.star.container.XNameAccess, com.sun.star.container.XNamed, com.sun.star.lang.IllegalArgumentException, com.sun.star.lang.WrappedTargetException, com.sun.star.lang.XMultiServiceFactory, com.sun.star.text.XReferenceMarksSupplier, com.sun.star.text.XText, com.sun.star.text.XTextContent, com.sun.star.text.XTextCursor, com.sun.star.text.XTextDocument, com.sun.star.text.XTextRange, com.sun.star.text.XTextRangeCompare, com.sun.star.uno.Exception, com.sun.star.uno.UnoRuntime, com.sun.star.uno.XComponentContext, org.slf4j.Logger, .LoggerFactory

Reference mark manager for BST-based citations.

Mirrors the behavior of CSLReferenceMarkManager but uses identifier terminology and supports applying a precomputed numbering map (e.g., from BST style order).

Field Summary

Modifier and TypeField and Description
private static final Pattern
private CSLCitationType
private final com.sun.star.uno.XComponentContext
private final com.sun.star.text.XTextDocument
private final com.sun.star.lang.XMultiServiceFactory
private int
private Map<String, Integer>
private boolean
private static final Logger
private final Map<String, BSTReferenceMark>
private final List<BSTReferenceMark>
private final com.sun.star.text.XTextRangeCompare

Constructor Summary

AccessConstructor and Description
public
BSTReferenceMarkManager(com.sun.star.text.XTextDocument document, com.sun.star.uno.XComponentContext componentContext)

Method Summary

Modifier and TypeMethod and Description
private int
public BSTReferenceMark
public int
public CSLCitationType
public List<BSTReferenceMark>
private String
private String
public boolean
public void
insertReferenceIntoOO(List<BibEntry> entries, com.sun.star.text.XTextDocument doc, com.sun.star.text.XTextCursor position, OOText ooText, boolean insertSpaceBefore, boolean insertSpaceAfter, CSLCitationType citationType)

public void
public void
public void
private void
private void
public void
updateAllCitationNumbers(Map<String, Integer> preferredIdentifierToNumber)

public void
private void
private void
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CITATION_NUMBER_PATTERNback to summary
private static final Pattern CITATION_NUMBER_PATTERN
citationTypeback to summary
private CSLCitationType citationType
componentContextback to summary
private final com.sun.star.uno.XComponentContext componentContext
documentback to summary
private final com.sun.star.text.XTextDocument document
factoryback to summary
private final com.sun.star.lang.XMultiServiceFactory factory
highestCitationNumberback to summary
private int highestCitationNumber
identifierToNumberback to summary
private Map<String, Integer> identifierToNumber
isNumberUpdateRequiredback to summary
private boolean isNumberUpdateRequired
LOGGERback to summary
private static final Logger LOGGER
marksByNameback to summary
private final Map<String, BSTReferenceMark> marksByName
marksInOrderback to summary
private final List<BSTReferenceMark> marksInOrder
textRangeCompareback to summary
private final com.sun.star.text.XTextRangeCompare textRangeCompare

Constructor Detail

BSTReferenceMarkManagerback to summary
public BSTReferenceMarkManager(com.sun.star.text.XTextDocument document, com.sun.star.uno.XComponentContext componentContext)

Method Detail

compareTextRangesback to summary
private int compareTextRanges(RangeSortEntry<BSTReferenceMark> first, RangeSortEntry<BSTReferenceMark> second)
createReferenceMarkback to summary
public BSTReferenceMark createReferenceMark(List<BibEntry> entries, CSLCitationType citationType) throws com.sun.star.uno.Exception
getCitationNumberback to summary
public int getCitationNumber(String identifier)
getCitationTypeback to summary
public CSLCitationType getCitationType()
getMarksInOrderback to summary
public List<BSTReferenceMark> getMarksInOrder()
getUpdatedCitationTextWithNewNumbersback to summary
private String getUpdatedCitationTextWithNewNumbers(String currentText, List<Integer> newNumbers)
getUpdatedReferenceMarkNameWithNewNumbersback to summary
private String getUpdatedReferenceMarkNameWithNewNumbers(String oldName, List<Integer> newNumbers)
hasCitationForIdentifierback to summary
public boolean hasCitationForIdentifier(String identifier)
insertReferenceIntoOOback to summary
public void insertReferenceIntoOO(List<BibEntry> entries, com.sun.star.text.XTextDocument doc, com.sun.star.text.XTextCursor position, OOText ooText, boolean insertSpaceBefore, boolean insertSpaceAfter, CSLCitationType citationType) throws CreationException, com.sun.star.uno.Exception
readAndUpdateExistingMarksback to summary
public void readAndUpdateExistingMarks() throws com.sun.star.lang.WrappedTargetException, com.sun.star.container.NoSuchElementException
readExistingMarksback to summary
public void readExistingMarks() throws com.sun.star.lang.WrappedTargetException, com.sun.star.container.NoSuchElementException
setRealTimeNumberUpdateRequiredback to summary
public void setRealTimeNumberUpdateRequired(boolean isNumeric)
sortMarksInOrderback to summary
private void sortMarksInOrder()
updateAllCitationNumbersback to summary
private void updateAllCitationNumbers() throws com.sun.star.uno.Exception, CreationException
updateAllCitationNumbersback to summary
public void updateAllCitationNumbers(Map<String, Integer> preferredIdentifierToNumber) throws com.sun.star.uno.Exception, CreationException
updateAllStyleDefinedCitationTextsback to summary
public void updateAllStyleDefinedCitationTexts(Map<String, String> identifierToLabelMap) throws com.sun.star.uno.Exception, CreationException, MissingStyleDefinedCitationLabelException
updateMarkAndTextback to summary
private void updateMarkAndText(BSTReferenceMark mark, String newText, String markName) throws com.sun.star.uno.Exception, CreationException
updateMarkAndTextWithNewNumbersback to summary
private void updateMarkAndTextWithNewNumbers(BSTReferenceMark mark, List<Integer> newNumbers) throws com.sun.star.uno.Exception, CreationException
updateMarkTextback to summary
private void updateMarkText(BSTReferenceMark mark, String newText) throws com.sun.star.uno.Exception, CreationException