Top Inners Fields Constructors Methods
org.jabref.logic.openoffice.action

public Class EditMerge

extends Object
Class Inheritance
Imports
java.util.ArrayList, .List, .Objects, .Optional, java.util.stream.Collectors, org.jabref.logic.openoffice.frontend.OOFrontend, .UpdateCitationMarkers, org.jabref.logic.openoffice.style.OOBibStyle, org.jabref.model.openoffice.ootext.OOText, org.jabref.model.openoffice.style.Citation, .CitationGroup, .CitationType, org.jabref.model.openoffice.uno.CreationException, .NoDocumentException, .UnoScreenRefresh, .UnoTextRange, org.jabref.model.openoffice.util.OOListUtil, com.sun.star.beans.IllegalTypeException, com.sun.star.beans.NotRemoveableException, com.sun.star.beans.PropertyVetoException, com.sun.star.lang.WrappedTargetException, com.sun.star.text.XTextCursor, com.sun.star.text.XTextDocument, com.sun.star.text.XTextRange, org.slf4j.Logger, .LoggerFactory

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static void
addToCurrentGroup(EditMerge.ScanState state, CitationGroup group, com.sun.star.text.XTextRange currentRange)

Add group to state.currentGroup Set state.cursorBetween to start at currentRange.getEnd() Expand state.currentGroupCursor to also cover currentRange Set state.prev to group, state.prevRange to currentRange

private static boolean

Returns:

false if cannot add, true if can. If returned true, then state.cursorBetween and state.currentGroupCursor are expanded to end at the start of currentRange.
checkAddToGroup
(EditMerge.ScanState state, CitationGroup
The CitationGroup to test
group
,
com.sun.star.text.XTextRange
The XTextRange corresponding to group.
currentRange
)

Decide if group could be added to state.currentGroup

public static boolean

Returns:

true if modified document
mergeCitationGroups
(com.sun.star.text.XTextDocument doc, OOFrontend frontend, OOBibStyle style)

private static List<EditMerge.JoinableGroupData>
scan(com.sun.star.text.XTextDocument doc, OOFrontend frontend)

Scan the document for joinable groups.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

EditMergeback to summary
private EditMerge()

Method Detail

addToCurrentGroupback to summary
private static void addToCurrentGroup(EditMerge.ScanState state, CitationGroup group, com.sun.star.text.XTextRange currentRange)

Add group to state.currentGroup Set state.cursorBetween to start at currentRange.getEnd() Expand state.currentGroupCursor to also cover currentRange Set state.prev to group, state.prevRange to currentRange

checkAddToGroupback to summary
private static boolean checkAddToGroup(EditMerge.ScanState state, CitationGroup group, com.sun.star.text.XTextRange currentRange)

Decide if group could be added to state.currentGroup

Parameters
group:CitationGroup

The CitationGroup to test

currentRange:com.sun.star.text.XTextRange

The XTextRange corresponding to group.

Returns:boolean

false if cannot add, true if can. If returned true, then state.cursorBetween and state.currentGroupCursor are expanded to end at the start of currentRange.

mergeCitationGroupsback to summary
public static boolean mergeCitationGroups(com.sun.star.text.XTextDocument doc, OOFrontend frontend, OOBibStyle style) throws CreationException, IllegalArgumentException, com.sun.star.beans.IllegalTypeException, NoDocumentException, com.sun.star.beans.NotRemoveableException, com.sun.star.beans.PropertyVetoException, com.sun.star.lang.WrappedTargetException
Returns:boolean

true if modified document

scanback to summary
private static List<EditMerge.JoinableGroupData> scan(com.sun.star.text.XTextDocument doc, OOFrontend frontend) throws NoDocumentException, com.sun.star.lang.WrappedTargetException

Scan the document for joinable groups. Return those found.

org.jabref.logic.openoffice.action back to summary

private Class EditMerge.JoinableGroupData

extends Object
Class Inheritance
  • java.lang.Object
  • org.jabref.logic.openoffice.action.EditMerge.JoinableGroupData

Field Summary

Modifier and TypeField and Description
pack-priv List<CitationGroup>
group

A list of consecutive citation groups only separated by spaces.

pack-priv com.sun.star.text.XTextCursor
groupCursor

A cursor covering the XTextRange of each entry in group (and the spaces between them)

Constructor Summary

AccessConstructor and Description
pack-priv
JoinableGroupData(List<CitationGroup> group, com.sun.star.text.XTextCursor groupCursor)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

groupback to summary
pack-priv List<CitationGroup> group

A list of consecutive citation groups only separated by spaces.

groupCursorback to summary
pack-priv com.sun.star.text.XTextCursor groupCursor

A cursor covering the XTextRange of each entry in group (and the spaces between them)

Constructor Detail

JoinableGroupDataback to summary
pack-priv JoinableGroupData(List<CitationGroup> group, com.sun.star.text.XTextCursor groupCursor)
org.jabref.logic.openoffice.action back to summary

private Class EditMerge.ScanState

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv List<CitationGroup>
pack-priv com.sun.star.text.XTextCursor
pack-priv com.sun.star.text.XTextCursor
pack-priv CitationGroup
pack-priv com.sun.star.text.XTextRange

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentGroupback to summary
pack-priv List<CitationGroup> currentGroup
currentGroupCursorback to summary
pack-priv com.sun.star.text.XTextCursor currentGroupCursor
cursorBetweenback to summary
pack-priv com.sun.star.text.XTextCursor cursorBetween
prevback to summary
pack-priv CitationGroup prev
prevRangeback to summary
pack-priv com.sun.star.text.XTextRange prevRange

Constructor Detail

ScanStateback to summary
pack-priv ScanState()

Method Detail

resetback to summary
pack-priv void reset()