Verified Owner
Top Description Inners Fields Constructors Methods
org.jabref.gui.documentviewer

public Class JumpToEntryPdfAction

extends SimpleCommand
Class Inheritance
Annotations
@NullMarked
Imports
java.net.URI, .URISyntaxException, java.nio.file.InvalidPathException, .Path, java.util.ArrayList, .Arrays, .List, .Optional, java.util.regex.Matcher, .Pattern, org.jabref.gui.DialogService, .StateManager, org.jabref.gui.actions.SimpleCommand, org.jabref.logic.l10n.Localization, org.jabref.logic.util.io.FileUtil, org.jabref.model.database.BibDatabaseContext, org.jabref.model.entry.BibEntry, .LinkedFile, org.jspecify.annotations.NullMarked, .Nullable, org.slf4j.Logger, .LoggerFactory

Opens the PDF of an entry addressed by an in-app link.

The link mirrors the REST API path of the entry (/libraries/{id}/entries/{key}) so that the same address works in jabsrv, cite-as-you-write and JabMap:

Both forms accept an optional /files/{n} segment selecting the {n}-th linked file (1-based, default: first PDF) and a #page={page} fragment as in the PDF Open Parameters understood by Acrobat.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static record

Field Summary

Modifier and TypeField and Description
private final DialogService
private static final Logger
private static final Pattern
public static final String
private final StateManager
private final String
Inherited from org.jabref.gui.actions.SimpleCommand:
statusMessage

Constructor Summary

AccessConstructor and Description
public
JumpToEntryPdfAction(String url, StateManager stateManager, DialogService dialogService)

Method Summary

Modifier and TypeMethod and Description
public void
private static boolean
private void
openInDocumentViewer(LinkedFile pdfFile, int page)

private static Optional<Integer>
public static Optional<JumpToEntryPdfAction.EntryLink>
parseUrl(@Nullable String rawUrl)

Returns: empty if the url is not an entry link (callers then fall back to opening it in the browser)

Inherited from org.jabref.gui.actions.SimpleCommand:
getProgressprogressPropertysetExecutablestatusMessageProperty

Field Detail

dialogServiceback to summary
private final DialogService dialogService
LOGGERback to summary
private static final Logger LOGGER
PAGE_FRAGMENTback to summary
private static final Pattern PAGE_FRAGMENT
SCHEMEback to summary
public static final String SCHEME
stateManagerback to summary
private final StateManager stateManager
urlback to summary
private final String url

Constructor Detail

JumpToEntryPdfActionback to summary
public JumpToEntryPdfAction(String url, StateManager stateManager, DialogService dialogService)

Method Detail

executeback to summary
public void execute()
Annotations
@Override
isPDFback to summary
private static boolean isPDF(LinkedFile file)
openInDocumentViewerback to summary
private void openInDocumentViewer(LinkedFile pdfFile, int page)
parsePositiveIntback to summary
private static Optional<Integer> parsePositiveInt(String value)
parseUrlback to summary
public static Optional<JumpToEntryPdfAction.EntryLink> parseUrl(@Nullable String rawUrl)
Returns:Optional<JumpToEntryPdfAction.EntryLink>

empty if the url is not an entry link (callers then fall back to opening it in the browser)