diff --git a/src/main/java/org/jabref/gui/icon/IconTheme.java b/src/main/java/org/jabref/gui/icon/IconTheme.java index c92fea5ac8e..996c0411b01 100644 --- a/src/main/java/org/jabref/gui/icon/IconTheme.java +++ b/src/main/java/org/jabref/gui/icon/IconTheme.java @@ -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), diff --git a/src/main/java/org/jabref/gui/push/PushToApplications.java b/src/main/java/org/jabref/gui/push/PushToApplications.java index e53e55b304d..d34e19d821b 100644 --- a/src/main/java/org/jabref/gui/push/PushToApplications.java +++ b/src/main/java/org/jabref/gui/push/PushToApplications.java @@ -29,6 +29,7 @@ public static List 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), diff --git a/src/main/java/org/jabref/gui/push/PushToSublimeText.java b/src/main/java/org/jabref/gui/push/PushToSublimeText.java new file mode 100644 index 00000000000..bffc632b58c --- /dev/null +++ b/src/main/java/org/jabref/gui/push/PushToSublimeText.java @@ -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 + "}\\}\'"}; + } +} \ No newline at end of file