Skip to content

Commit

Permalink
enable Mnemonics for sidepane actions - fixes #2224
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasgeiger committed Nov 2, 2016
1 parent 1f6c2e3 commit e0e788e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/main/java/net/sf/jabref/gui/SidePaneComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;

import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.BorderFactory;
import javax.swing.Icon;
Expand All @@ -15,6 +14,8 @@
import javax.swing.JToolBar;
import javax.swing.KeyStroke;

import net.sf.jabref.gui.actions.MnemonicAwareAction;

import org.jdesktop.swingx.JXTitledPanel;
import org.jdesktop.swingx.painter.MattePainter;

Expand Down Expand Up @@ -112,17 +113,18 @@ public Dimension getMinimumSize() {
public abstract ToggleAction getToggleAction();


public class ToggleAction extends AbstractAction {
public class ToggleAction extends MnemonicAwareAction {

public ToggleAction(String text, String description, KeyStroke key, IconTheme.JabRefIcon icon){
super(text, icon.getSmallIcon());
super(icon.getIcon());
putValue(Action.NAME, text);
putValue(Action.ACCELERATOR_KEY, key);
putValue(Action.LARGE_ICON_KEY, icon.getIcon());
putValue(Action.SHORT_DESCRIPTION, description);
}

public ToggleAction(String text, String description, KeyStroke key, Icon icon){
super(text, icon);
super(icon);
putValue(Action.NAME, text);
putValue(Action.ACCELERATOR_KEY, key);
putValue(Action.SHORT_DESCRIPTION, description);
}
Expand Down

0 comments on commit e0e788e

Please sign in to comment.