package com.github.kotlinee.framework.vaadin;

import org.jetbrains.annotations.NotNull;

import com.vaadin.event.ShortcutListener;

/**
 * @author mvy
 */
public class ShortcutListeners {
	public static ShortcutListener listener(int keyCode, @NotNull int[] modifierKeys, final @NotNull Runnable action) {
		return new ShortcutListener(null, keyCode, modifierKeys) {
			@Override
			public void handleAction(Object sender, Object target) {
				action.run();
			}
		};
	}
}

@@ -40,16 +40,55 @@
 aadin;%0A%0A
+import kotlin.jvm.functions.Function0;%0A
 import o
@@ -323,16 +323,20 @@
 ull 
-Runnable
+Function0%3C?%3E
  act
@@ -491,11 +491,14 @@
 ion.
-run
+invoke
 ();%0A

Fix around ShortcutListeners not serializable