Top Constructors Methods
org.jabref.model.openoffice.uno

public Class UnoTextSection

extends Object
Class Inheritance
Imports
java.util.Optional, org.jabref.model.openoffice.DocumentAnnotation, com.sun.star.container.NoSuchElementException, com.sun.star.container.XNameAccess, com.sun.star.container.XNamed, com.sun.star.lang.DisposedException, com.sun.star.lang.WrappedTargetException, com.sun.star.text.XTextContent, com.sun.star.text.XTextDocument, com.sun.star.text.XTextRange, com.sun.star.text.XTextSection, com.sun.star.text.XTextSectionsSupplier, com.sun.star.uno.Any

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static com.sun.star.container.XNamed
create(DocumentAnnotation documentAnnotation)

Create a text section with the provided name and insert it at the provided cursor.

public static Optional<com.sun.star.text.XTextRange>

Returns:

The XTextRange for the section, or Optional.empty().
getAnchor
(com.sun.star.text.XTextDocument doc, String
The name of the section to find.
name
)

Get the XTextRange covering to the named section.

public static Optional<com.sun.star.text.XTextSection>
getByName(com.sun.star.text.XTextDocument doc, String name)

Get an XTextSection by name.

public static com.sun.star.container.XNameAccess

Returns:

An XNameAccess to find sections by name.
getNameAccess
(com.sun.star.text.XTextDocument doc)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

UnoTextSectionback to summary
public UnoTextSection()

Method Detail

createback to summary
public static com.sun.star.container.XNamed create(DocumentAnnotation documentAnnotation) throws CreationException

Create a text section with the provided name and insert it at the provided cursor. If an XTextSection by that name already exists, LibreOffice (6.4.6.2) creates a section with a name different from what we requested, in "Section {number}" format

getAnchorback to summary
public static Optional<com.sun.star.text.XTextRange> getAnchor(com.sun.star.text.XTextDocument doc, String name) throws com.sun.star.lang.WrappedTargetException, NoDocumentException

Get the XTextRange covering to the named section.

Parameters
name:String

The name of the section to find.

Returns:Optional<com.sun.star.text.XTextRange>

The XTextRange for the section, or Optional.empty().

getByNameback to summary
public static Optional<com.sun.star.text.XTextSection> getByName(com.sun.star.text.XTextDocument doc, String name) throws com.sun.star.lang.WrappedTargetException, NoDocumentException

Get an XTextSection by name.

getNameAccessback to summary
public static com.sun.star.container.XNameAccess getNameAccess(com.sun.star.text.XTextDocument doc) throws NoDocumentException
Returns:com.sun.star.container.XNameAccess

An XNameAccess to find sections by name.