Skip to content

Commit

Permalink
Add toolbar icon for deleting an entry, and move menu item for this a…
Browse files Browse the repository at this point in the history
…ction to BibTeX
  • Loading branch information
simonharrer committed Nov 26, 2015
1 parent 1332070 commit a7c0d4c
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ to [sourceforge feature requests](https://sourceforge.net/p/jabref/features/) by

### Changed
- Updated to support OpenOffice 4 and LibreOffice 5
- Add toolbar icon for deleting an entry, and move menu item for this action to BibTeX
- Better support for IEEEtranBSTCTL entries
- Quick selection of month in entry editor
- Unknown entry types will be converted to 'Misc' (was 'Other' before).
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/sf/jabref/gui/IconTheme.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public enum JabRefIcon {
MARK_ENTRIES("\uf1a6") /*css: bookmark */,
UNMARK_ENTRIES("\uf1a9") /*css: bookmark-outline */,
REFRESH("\uf4ef") /*css: refresh */,
DELETE("\uf28d") /*css: delete */,
DELETE_ENTRY("\uf28d") /*css: delete */,
SEARCH("\uf401") /*css: magnify */,
PREFERENCES("\uf529") /*css: settings */,
HELP("\uf396") /*css: help-circle*/,
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/sf/jabref/gui/ImportInspectionDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public ImportInspectionDialog(JabRefFrame frame, BasePanel panel, String[] field
GeneralRenderer renderer = new GeneralRenderer(Color.white);
glTable.setDefaultRenderer(JLabel.class, renderer);
glTable.setDefaultRenderer(String.class, renderer);
glTable.getInputMap().put(Globals.prefs.getKey(KeyBinds.DELETE), "delete");
glTable.getInputMap().put(Globals.prefs.getKey(KeyBinds.DELETE_ENTRY), "delete");
DeleteListener deleteListener = new DeleteListener();
glTable.getActionMap().put("delete", deleteListener);

Expand Down Expand Up @@ -881,7 +881,7 @@ public void actionPerformed(ActionEvent event) {
class DeleteListener extends AbstractAction {

public DeleteListener() {
super(Localization.lang("Delete"), IconTheme.JabRefIcon.DELETE.getSmallIcon());
super(Localization.lang("Delete"), IconTheme.JabRefIcon.DELETE_ENTRY.getSmallIcon());
}

@Override
Expand Down
16 changes: 10 additions & 6 deletions src/main/java/net/sf/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ void addJToogleButton(JToggleButton button) {
Localization.lang("Forward"), prefs.getKey(KeyBinds.FORWARD), IconTheme.JabRefIcon.RIGHT.getIcon());
final AbstractAction back = new GeneralAction(Actions.BACK, Localization.menuTitle("Back"),
Localization.lang("Back"), prefs.getKey(KeyBinds.BACK), IconTheme.JabRefIcon.LEFT.getIcon());
private final AbstractAction delete = new GeneralAction(Actions.DELETE, Localization.menuTitle("Delete"),
Localization.lang("Delete"), prefs.getKey(KeyBinds.DELETE), IconTheme.JabRefIcon.DELETE.getIcon());
final AbstractAction deleteEntry = new GeneralAction(Actions.DELETE, Localization.menuTitle("Delete entry"),
Localization.lang("Delete entry"), prefs.getKey(KeyBinds.DELETE_ENTRY), IconTheme.JabRefIcon.DELETE_ENTRY.getIcon());
private final AbstractAction copy = new EditAction(Actions.COPY, Localization.lang("Copy"),
IconTheme.JabRefIcon.COPY.getIcon());
private final AbstractAction paste = new EditAction(Actions.PASTE, Localization.lang("Paste"),
Expand Down Expand Up @@ -1182,17 +1182,17 @@ private void fillMenu() {
file.add(closeDatabaseAction);
file.add(quit);
mb.add(file);
//edit.add(test);
edit.add(undo);
edit.add(redo);

edit.addSeparator();

edit.add(cut);
edit.add(copy);
edit.add(paste);
//edit.add(remove);
edit.add(delete);

edit.addSeparator();

edit.add(copyKey);
edit.add(copyCiteKey);
edit.add(copyKeyAndTitle);
Expand Down Expand Up @@ -1301,6 +1301,8 @@ private void fillMenu() {
bibtex.add(editEntry);
bibtex.add(editPreamble);
bibtex.add(editStrings);
bibtex.addSeparator();
bibtex.add(deleteEntry);
mb.add(bibtex);

tools.add(makeKeyAction);
Expand Down Expand Up @@ -1433,6 +1435,8 @@ private void createToolBar() {
tlb.addAction(newEntryAction);
tlb.addAction(editEntry);
tlb.addAction(editStrings);
tlb.addAction(deleteEntry);
tlb.addSeparator();
tlb.addAction(makeKeyAction);
tlb.addAction(cleanupEntries);
tlb.addAction(mergeEntries);
Expand Down Expand Up @@ -1526,7 +1530,7 @@ public void stopShowingSearchResults() {
private void initActions() {
openDatabaseOnlyActions = new LinkedList<>();
openDatabaseOnlyActions.addAll(Arrays.asList(manageSelectors, mergeDatabaseAction, newSubDatabaseAction, save,
saveAs, saveSelectedAs, saveSelectedAsPlain, undo, redo, cut, delete, copy, paste, mark, unmark,
saveAs, saveSelectedAs, saveSelectedAsPlain, undo, redo, cut, deleteEntry, copy, paste, mark, unmark,
unmarkAll, editEntry, selectAll, copyKey, copyCiteKey, copyKeyAndTitle, editPreamble, editStrings,
toggleGroups, toggleSearch, makeKeyAction, normalSearch, mergeEntries, cleanupEntries,
exportToClipboard, incrementalSearch, replaceAll, sendAsEmail, downloadFullText, writeXmpAction,
Expand Down
8 changes: 1 addition & 7 deletions src/main/java/net/sf/jabref/gui/RightClickMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,10 @@
import net.sf.jabref.groups.structure.AbstractGroup;
import net.sf.jabref.groups.structure.AllEntriesGroup;
import net.sf.jabref.gui.actions.Actions;
import net.sf.jabref.gui.actions.ChangeTypeAction;
import net.sf.jabref.gui.menus.ChangeEntryTypeMenu;
import net.sf.jabref.gui.worker.MarkEntriesAction;
import net.sf.jabref.logic.CustomEntryTypesManager;
import net.sf.jabref.logic.l10n.Localization;
import net.sf.jabref.model.entry.BibtexEntry;
import net.sf.jabref.bibtex.EntryTypes;
import net.sf.jabref.model.entry.BibtexEntryTypes;
import net.sf.jabref.model.entry.EntryType;
import net.sf.jabref.model.entry.IEEETranEntryTypes;
import net.sf.jabref.specialfields.Printed;
import net.sf.jabref.specialfields.Priority;
import net.sf.jabref.specialfields.Quality;
Expand Down Expand Up @@ -82,7 +76,7 @@ public RightClickMenu(BasePanel panel_, MetaData metaData_) {
add(new GeneralAction(Actions.COPY, Localization.lang("Copy"), IconTheme.JabRefIcon.COPY.getSmallIcon()));
add(new GeneralAction(Actions.PASTE, Localization.lang("Paste"), IconTheme.JabRefIcon.PASTE.getSmallIcon()));
add(new GeneralAction(Actions.CUT, Localization.lang("Cut"), IconTheme.JabRefIcon.CUT.getSmallIcon()));
add(new GeneralAction(Actions.DELETE, Localization.lang("Delete"), IconTheme.JabRefIcon.DELETE.getSmallIcon()));
add(new GeneralAction(Actions.DELETE, Localization.lang("Delete"), IconTheme.JabRefIcon.DELETE_ENTRY.getSmallIcon()));
addSeparator();

add(new GeneralAction(Actions.COPY_KEY, Localization.lang("Copy BibTeX key")));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@ public void run() {

class DeleteAction extends AbstractAction {
public DeleteAction() {
super(Localization.lang("Delete"), IconTheme.JabRefIcon.DELETE.getIcon());
super(Localization.lang("Delete"), IconTheme.JabRefIcon.DELETE_ENTRY.getIcon());
putValue(Action.SHORT_DESCRIPTION, Localization.lang("Delete entry"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ class ExternalFileEntry {
private final JTextField tf;
private final JButton browse = new JButton(Localization.lang("Browse"));
private final JButton view = new JButton(Localization.lang("Preview"));
private final JButton clear = new JButton(IconTheme.JabRefIcon.DELETE.getIcon());
private final JButton clear = new JButton(IconTheme.JabRefIcon.DELETE_ENTRY.getIcon());
private final JButton download = new JButton(Localization.lang("Download"));


Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/sf/jabref/gui/keyboard/KeyBinds.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class KeyBinds {
public static final String COPY_CITE_BIB_TE_X_KEY = "Copy \\cite{BibTeX key}";
public static final String CUT = "Cut";
public static final String DECREASE_TABLE_FONT_SIZE = "Decrease table font size";
public static final String DELETE = "Delete";
public static final String DELETE_ENTRY = "Delete entry";
public static final String EDIT_ENTRY = "Edit entry";
public static final String EDIT_PREAMBLE = "Edit preamble";
public static final String EDIT_STRINGS = "Edit strings";
Expand Down Expand Up @@ -164,7 +164,7 @@ public KeyBinds() {
keyBindMap.put(NEXT_TAB, "ctrl PAGE_DOWN");
keyBindMap.put(PREVIOUS_TAB, "ctrl PAGE_UP");
keyBindMap.put(REPLACE_STRING, "ctrl R");
keyBindMap.put(DELETE, "DELETE");
keyBindMap.put(DELETE_ENTRY, "DELETE");
keyBindMap.put(OPEN_FILE, "F4");
keyBindMap.put(OPEN_FOLDER, "ctrl shift O");
keyBindMap.put(OPEN_URL_OR_DOI, "F3");
Expand Down

0 comments on commit a7c0d4c

Please sign in to comment.