Skip to content

Commit

Permalink
Add sublime text editor as external push application
Browse files Browse the repository at this point in the history
Fixes #10098

Co-authored-by: AdamWysokinski <[email protected]>
  • Loading branch information
Siedlerchr and AdamWysokinski committed Jul 22, 2023
1 parent 1332e29 commit a2e5e9e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/org/jabref/gui/icon/IconTheme.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ public enum JabRefIcons implements JabRefIcon {
APPLICATION_TEXMAKER(JabRefMaterialDesignIcon.TEX_MAKER),
APPLICATION_VIM(JabRefMaterialDesignIcon.VIM),
APPLICATION_WINEDT(JabRefMaterialDesignIcon.WINEDT),
APPLICATION_SUBLIMETEXT(MaterialDesignA.APPLICATION),
KEY_BINDINGS(MaterialDesignK.KEYBOARD),
FIND_DUPLICATES(MaterialDesignC.CODE_EQUAL),
CONNECT_DB(MaterialDesignC.CLOUD_UPLOAD),
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/jabref/gui/push/PushToApplications.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public static List<PushToApplication> getAllApplications(DialogService dialogSer
APPLICATIONS.addAll(List.of(
new PushToEmacs(dialogService, preferencesService),
new PushToLyx(dialogService, preferencesService),
new PushToSublimeText(dialogService, preferencesService),
new PushToTexmaker(dialogService, preferencesService),
new PushToTeXstudio(dialogService, preferencesService),
new PushToVim(dialogService, preferencesService),
Expand Down
33 changes: 33 additions & 0 deletions src/main/java/org/jabref/gui/push/PushToSublimeText.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package org.jabref.gui.push;

import org.jabref.gui.DialogService;
import org.jabref.gui.icon.IconTheme;
import org.jabref.gui.icon.JabRefIcon;
import org.jabref.preferences.PreferencesService;

/**
* Class for pushing entries into SublimeText.
*/
public class PushToSublimeText extends AbstractPushToApplication {

public static final String NAME = "SublimeText";

public PushToSublimeText(DialogService dialogService, PreferencesService preferencesService) {
super(dialogService, preferencesService);
}

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

@Override
public JabRefIcon getApplicationIcon() {
return IconTheme.JabRefIcons.APPLICATION_SUBLIMETEXT;
}

@Override
protected String[] getCommandLine(String keyString) {
return new String[] {commandPath, "--command \'insert {\"characters\": \"\\", getCiteCommand() + "{" + keyString + "}\\}\'"};
}
}

0 comments on commit a2e5e9e

Please sign in to comment.