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

public Class UnoBookmark

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.XBookmarksSupplier, com.sun.star.text.XTextContent, com.sun.star.text.XTextDocument, com.sun.star.text.XTextRange

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static com.sun.star.container.XNamed

Returns:

The XNamed interface of the bookmark. result.getName() should be checked by the caller, because its name may differ from the one requested.
create
(DocumentAnnotation documentAnnotation)

Insert a bookmark with the given name at the cursor provided, or with another name if the one we asked for is already in use.

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

Returns:

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

Get the XTextRange corresponding to the named bookmark.

public static com.sun.star.container.XNameAccess
getNameAccess(com.sun.star.text.XTextDocument doc)

Provides access to bookmarks by name.

public static void
removeIfExists(com.sun.star.text.XTextDocument doc, String name)

Remove the named bookmark if it exists.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

UnoBookmarkback to summary
private UnoBookmark()

Method Detail

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

Insert a bookmark with the given name at the cursor provided, or with another name if the one we asked for is already in use.

In LibreOffice the another name is in "{name}{number}" format.

Returns:com.sun.star.container.XNamed

The XNamed interface of the bookmark. result.getName() should be checked by the caller, because its name may differ from the one requested.

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 corresponding to the named bookmark.

Parameters
name:String

The name of the bookmark to find.

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

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

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

Provides access to bookmarks by name.

removeIfExistsback to summary
public static void removeIfExists(com.sun.star.text.XTextDocument doc, String name) throws NoDocumentException, com.sun.star.lang.WrappedTargetException

Remove the named bookmark if it exists.