Enabled Esc for read-only version of edit signature balloon.

This commit is contained in:
Evgeny Gerashchenko
2012-09-04 18:15:34 +04:00
parent c0f633d280
commit 43017f2035
@@ -121,13 +121,6 @@ class EditSignatureBalloon {
}
};
ActionListener cancelActionListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
balloon.hide();
}
};
saveButton.addActionListener(saveAndHideListener);
deleteButton.addActionListener(new ActionListener() {
@Override
@@ -137,10 +130,15 @@ class EditSignatureBalloon {
});
panel.registerKeyboardAction(saveAndHideListener, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.CTRL_DOWN_MASK),
JComponent.WHEN_IN_FOCUSED_WINDOW);
panel.registerKeyboardAction(cancelActionListener, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
JComponent.WHEN_IN_FOCUSED_WINDOW);
}
panel.registerKeyboardAction(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
balloon.hide();
}
}, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
return panel;
}