lambda expression template [message #1350769] |
Mon, 12 May 2014 16:28  |
Eclipse User |
|
|
|
Hi
I wanted to check Java 8 integration with Eclipse Luna so I downloaded the M7 Luna from eclipse.org.
After configuring the JDK to jdk8u5, I started some tests.
Let's say you have a nice Runnable like
Runnable r = new Runnable() {
@Override
public void run() {
System.out.println("foo");
}
};
If you select the
new Runnable() {
@Override
public void run() {
System.out.println("foo");
}
}
block and press Ctrl-1 (Quick Fix), you get the suggestion to change it to a lambda, resulting in Runnable r = () -> System.out.println("foo"); , which is pretty cool.
But a nicer thing whould be to actually help creating lambda expression. For instance, if you type (with | being the cursor location) and press ctrl+Space (content-assist), I would have expected to find a "create a lambda expression from this functional interface" option in the displayed popup. But nothing new is available.
Do you know if this will be implemented in the future ? I think it might have something to do with the templates (Java/Editor/Templates in preferences) but I actually never experimented with them.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.24802 seconds