Ctrl+Enter shortcut doesn't call controller.commitAndClose as it should #PL-2205

This commit is contained in:
Konstantin Devyatkin 2013-06-10 16:14:10 +00:00
parent 82c935585f
commit 52bbcf8a90
3 changed files with 10 additions and 22 deletions

View File

@ -802,17 +802,6 @@ public class DesktopWindow implements Window, Component.Disposable,
public static class Editor extends DesktopWindow implements Window.Editor {
public Editor() {
super();
addAction(new AbstractShortcutAction("commitAndCloseAction",
new ShortcutAction.KeyCombination(ShortcutAction.Key.ENTER, ShortcutAction.Modifier.CTRL)) {
@Override
public void actionPerform(com.haulmont.cuba.gui.components.Component component) {
commitAndClose();
}
});
}
@Override
protected WindowDelegate createDelegate() {
return new EditorWindowDelegate(this);

View File

@ -82,6 +82,16 @@ public class EditorWindowDelegate extends WindowDelegate {
}
);
this.window.addAction(new AbstractShortcutAction("commitAndCloseShortcutAction",
new ShortcutAction.KeyCombination(ShortcutAction.Key.ENTER, ShortcutAction.Modifier.CTRL)) {
@Override
public void actionPerform(com.haulmont.cuba.gui.components.Component component) {
editor.commitAndClose();
}
});
this.window.addAction(
new AbstractAction(Window.Editor.WINDOW_CLOSE) {
@Override

View File

@ -818,17 +818,6 @@ public class WebWindow implements Window, Component.Wrapper,
public static class Editor extends WebWindow implements Window.Editor {
public Editor() {
super();
addAction(new AbstractShortcutAction("commitAndCloseAction",
new ShortcutAction.KeyCombination(ShortcutAction.Key.ENTER, ShortcutAction.Modifier.CTRL)) {
@Override
public void actionPerform(com.haulmont.cuba.gui.components.Component component) {
commitAndClose();
}
});
}
@Override
protected WindowDelegate createDelegate() {
return new EditorWindowDelegate(this);