Merge lp:~tapaal-contributor/tapaal/shortcut-undo-1941839 into lp:tapaal

Proposed by Lena Ernstsen
Status: Merged
Approved by: Jiri Srba
Approved revision: 1150
Merged at revision: 1150
Proposed branch: lp:~tapaal-contributor/tapaal/shortcut-undo-1941839
Merge into: lp:tapaal
Diff against target: 38 lines (+22/-1)
1 file modified
src/pipe/gui/widgets/QueryDialog.java (+22/-1)
To merge this branch: bzr merge lp:~tapaal-contributor/tapaal/shortcut-undo-1941839
Reviewer Review Type Date Requested Status
Jiri Srba Approve
Review via email: mp+409591@code.launchpad.net

Commit message

Added shortcuts for undo and redo in query dialog

Description of the change

When pressing ctrl+z in the query dialog the last change will be undone
When pressing ctrl+y the it will be redone

To post a comment you must log in.
Revision history for this message
Jiri Srba (srba) wrote :

Tested and works

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/pipe/gui/widgets/QueryDialog.java'
--- src/pipe/gui/widgets/QueryDialog.java 2021-09-29 09:36:24 +0000
+++ src/pipe/gui/widgets/QueryDialog.java 2021-10-04 17:37:22 +0000
@@ -339,7 +339,8 @@
339 setLayout(new GridBagLayout());339 setLayout(new GridBagLayout());
340340
341 init(option, queryToCreateFrom);341 init(option, queryToCreateFrom);
342 toggleAdvancedSimpleView(false);342 makeShortcuts();
343 toggleAdvancedSimpleView(false);
343 }344 }
344345
345 private boolean checkIfSomeReductionOption() {346 private boolean checkIfSomeReductionOption() {
@@ -3348,4 +3349,24 @@
33483349
3349 }3350 }
33503351
3352 private void makeShortcuts(){
3353 int shortcutkey = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
3354 ActionMap am = this.getActionMap();
3355 am.put("undo", new AbstractAction() {
3356 @Override
3357 public void actionPerformed(ActionEvent e) {
3358 undoButton.doClick();
3359 }
3360 });
3361 am.put("redo", new AbstractAction() {
3362 @Override
3363 public void actionPerformed(ActionEvent e) {
3364 redoButton.doClick();
3365 }
3366 });
3367 InputMap im = this.getInputMap(JPanel.WHEN_IN_FOCUSED_WINDOW);
3368 im.put(KeyStroke.getKeyStroke('Z', shortcutkey), "undo");
3369 im.put(KeyStroke.getKeyStroke('Y', shortcutkey), "redo");
3370 }
3371
3351}3372}

Subscribers

People subscribed via source and target branches