Verified Owner
Top Description Fields Constructors Methods
org.jabref.logic.push

public abstract Class AbstractPushToApplication

extends Object
implements PushToApplication
Class Inheritance
All Implemented Interfaces
org.jabref.logic.push.PushToApplication
Known Direct Subclasses
org.jabref.logic.push.PushToEmacs, org.jabref.logic.push.PushToLyx, org.jabref.logic.push.PushToSublimeText, org.jabref.logic.push.PushToTexmaker, org.jabref.logic.push.PushToTexShop, org.jabref.logic.push.PushToTeXstudio, org.jabref.logic.push.PushToTeXworks, org.jabref.logic.push.PushToVim, org.jabref.logic.push.PushToVScode, org.jabref.logic.push.PushToWinEdt
Imports
java.io.IOException, java.nio.file.Path, java.util.ArrayList, .Arrays, .Collections, .List, .Optional, java.util.stream.Collectors, org.jabref.logic.l10n.Localization, org.jabref.logic.os.OS, org.jabref.logic.util.NotificationService, org.jabref.logic.util.strings.StringUtil, org.jabref.model.entry.BibEntry, com.google.common.annotations.VisibleForTesting, org.jspecify.annotations.NonNull, org.slf4j.Logger, .LoggerFactory

Abstract class for pushing entries into different editors.

Field Summary

Modifier and TypeField and Description
protected String
protected boolean
protected boolean
private static final Logger
protected boolean
protected final NotificationService
protected final PushToApplicationPreferences

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected String
protected String
protected String[]

Returns:

String array with the command to call and its arguments
getCommandLine
(String
String containing the Bibtex keys to be pushed to the application
keyString
)

Constructs the command line arguments for pushing citations to the application.

public String

Returns:

String with the command name
getCommandName
()

Function to get the command name in case it is different from the application name

public String
getDelimiter()

Implements org.jabref.logic.push.PushToApplication.getDelimiter.

Get the delimiter used to separate citation keys.

protected String
getKeyString(List<BibEntry> entries, @NonNull String delimiter)

public void
jumpToLine(Path fileName, int line, int column)

Implements org.jabref.logic.push.PushToApplication.jumpToLine.

protected String[]
jumpToLineCommandlineArguments(Path fileName, int line, int column)

public void
onOperationCompleted()

Implements org.jabref.logic.push.PushToApplication.onOperationCompleted.

Reporting etc., this method is called on the event dispatch thread after pushEntries() returns.

public void
public void
pushEntries(List<BibEntry> entries, ProcessBuilder processBuilder)

public boolean
requiresCitationKeys()

Implements org.jabref.logic.push.PushToApplication.requiresCitationKeys.

Check whether this operation requires citation keys to be set for the entries.

public void
sendErrorNotification(String message)

Implements org.jabref.logic.push.PushToApplication.sendErrorNotification.

Used to route to either the GUI or the CLI - dependent on the usage

public void
sendErrorNotification(String title, String message)

Implements org.jabref.logic.push.PushToApplication.sendErrorNotification.

Used to route to either the GUI or the CLI - dependent on the usage

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

commandPathback to summary
protected String commandPath
couldNotCallback to summary
protected boolean couldNotCall
couldNotPushback to summary
protected boolean couldNotPush
LOGGERback to summary
private static final Logger LOGGER
notDefinedback to summary
protected boolean notDefined
notificationServiceback to summary
protected final NotificationService notificationService
preferencesback to summary
protected final PushToApplicationPreferences preferences

Constructor Detail

AbstractPushToApplicationback to summary
public AbstractPushToApplication(NotificationService notificationService, PushToApplicationPreferences preferences)

Method Detail

getCitePrefixback to summary
protected String getCitePrefix()
getCiteSuffixback to summary
protected String getCiteSuffix()
getCommandLineback to summary
protected String[] getCommandLine(String keyString)

Constructs the command line arguments for pushing citations to the application. The method formats the citation key and prefixes/suffixes as per user preferences before invoking the application with the command to insert text.

Parameters
keyString:String

String containing the Bibtex keys to be pushed to the application

Returns:String[]

String array with the command to call and its arguments

Annotations
@SuppressWarnings:unused
getCommandNameback to summary
public String getCommandName()

Function to get the command name in case it is different from the application name

Returns:String

String with the command name

getDelimiterback to summary
public String getDelimiter()

Implements org.jabref.logic.push.PushToApplication.getDelimiter.

Doc from org.jabref.logic.push.PushToApplication.getDelimiter.

Get the delimiter used to separate citation keys.

getKeyStringback to summary
protected String getKeyString(List<BibEntry> entries, @NonNull String delimiter)
jumpToLineback to summary
public void jumpToLine(Path fileName, int line, int column)

Implements org.jabref.logic.push.PushToApplication.jumpToLine.

jumpToLineCommandlineArgumentsback to summary
protected String[] jumpToLineCommandlineArguments(Path fileName, int line, int column)
onOperationCompletedback to summary
public void onOperationCompleted()

Implements org.jabref.logic.push.PushToApplication.onOperationCompleted.

Doc from org.jabref.logic.push.PushToApplication.onOperationCompleted.

Reporting etc., this method is called on the event dispatch thread after pushEntries() returns.

Annotations
@Override
pushEntriesback to summary
public void pushEntries(List<BibEntry> entries)

Implements org.jabref.logic.push.PushToApplication.pushEntries.

Doc from org.jabref.logic.push.PushToApplication.pushEntries.

The actual operation. This method will not be called on the event dispatch thread, so it should not do GUI operations without utilizing invokeLater().

pushEntriesback to summary
public void pushEntries(List<BibEntry> entries, ProcessBuilder processBuilder)
Annotations
@VisibleForTesting
requiresCitationKeysback to summary
public boolean requiresCitationKeys()

Implements org.jabref.logic.push.PushToApplication.requiresCitationKeys.

Doc from org.jabref.logic.push.PushToApplication.requiresCitationKeys.

Check whether this operation requires citation keys to be set for the entries. If true is returned an error message will be displayed if keys are missing.

Annotations
@Override
sendErrorNotificationback to summary
public void sendErrorNotification(String message)

Implements org.jabref.logic.push.PushToApplication.sendErrorNotification.

Doc from org.jabref.logic.push.PushToApplication.sendErrorNotification.

Used to route to either the GUI or the CLI - dependent on the usage

Annotations
@Override
sendErrorNotificationback to summary
public void sendErrorNotification(String title, String message)

Implements org.jabref.logic.push.PushToApplication.sendErrorNotification.

Doc from org.jabref.logic.push.PushToApplication.sendErrorNotification.

Used to route to either the GUI or the CLI - dependent on the usage

Annotations
@Override