Skip to content

Commit

Permalink
Merge branch 'JabRef#3197-TeXworks' of github.com:vladdobre/jabref into
Browse files Browse the repository at this point in the history
JabRef#3197-TeXworks
  • Loading branch information
lachiri-ilias committed Feb 29, 2024
2 parents 7fd5d07 + b8d7079 commit 5b69389
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/main/java/org/jabref/gui/push/PushToTeXworks.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,49 @@ public class PushToTeXworks extends AbstractPushToApplication {

public static final String NAME = PushToApplications.TEXWORKS;

/**
* Constructs a new {@code PushToTeXworks} instance.
*
* @param dialogService The dialog service for displaying messages to the user.
* @param preferencesService The service for accessing user preferences.
*/
public PushToTeXworks(DialogService dialogService, PreferencesService preferencesService) {
super(dialogService, preferencesService);
}

/**
* Gets the display name for the TeXworks push operation. This name is used
* in the GUI to represent the push action to the user.
*
* @return The display name for the push operation.
*/

@Override
public String getDisplayName() {
return NAME;
}

/**
* Gets the icon associated with the TeXworks application.
* TODO: replace the placerholer icon with the real one.
*
* @return The icon for the TeXworks application.
*/

@Override
public JabRefIcon getApplicationIcon() {
return IconTheme.JabRefIcons.DEFAULT_GROUP_ICON; // Temporary Icon that needs to be changed
}


/**
* Constructs the command line arguments for pushing citations to TeXworks.
* The method formats the citation key and prefixes/suffixes as per user preferences
* before invoking TeXworks with the command to insert text.
*
* @param keyString The citation key to be pushed.
* @return An array of {@code String} containing the command line to execute.
*/
@Override
protected String[] getCommandLine(String keyString) {
return new String[] {commandPath, "--insert-text", "%s%s%s".formatted(getCitePrefix(), keyString, getCiteSuffix())};
Expand Down

0 comments on commit 5b69389

Please sign in to comment.