Bug 519028 - [templates] Button selection listener template should use new SelectionListener helper methods for lambda
Summary: [templates] Button selection listener template should use new SelectionListen...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.7   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Lars Vogel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 95787
Blocks:
  Show dependency tree
 
Reported: 2017-06-30 07:19 EDT by Lars Vogel CLA
Modified: 2018-02-12 08:14 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2017-06-30 07:19:14 EDT
In Bug 387272 we introduced a selection listener to the button templates. Now that SWT has lambda helper methods for SelectionListener I suggest updating the template.
Comment 1 Eclipse Genie CLA 2017-11-08 16:03:21 EST
New Gerrit change created: https://git.eclipse.org/r/111261
Comment 2 Noopur Gupta CLA 2017-11-10 01:08:31 EST
Few points to consider in this change:

- The updated template based on lambda expression will give compile error for projects < Java 8.

- If this is accepted, it should be done for all other applicable templates also.

- Based on the discussion in bug 387272, need to check with Dani regarding the addition of quotes in setText().
Comment 3 Dani Megert CLA 2017-11-10 05:33:07 EST
(In reply to Noopur Gupta from comment #2)
> Few points to consider in this change:
> 
> - The updated template based on lambda expression will give compile error
> for projects < Java 8.
> 
> - If this is accepted, ...

This is a no go. We first have to fix bug 95787. And we definitely don't want to duplicate the template(s) based on the Java version.


> - Based on the discussion in bug 387272, need to check with Dani regarding
> the addition of quotes in setText().

This change has nothing to do with this bug report ;-). And we don't want quotes there as per previous comments.
Comment 4 Lars Vogel CLA 2017-11-10 11:54:00 EST
Dani, Noopur, since 1-2 years SWT requires Java 8.
Comment 5 Dani Megert CLA 2017-11-10 12:00:40 EST
(In reply to Lars Vogel from comment #4)
> Dani, Noopur, since 1-2 years SWT requires Java 8.

It is irrelevant what SWT requires. It is relevant what clients use. Just take a quick look at https://www.eclipse.org/projects/project-plan.php?planurl=http://www.eclipse.org/eclipse/development/plans/eclipse_project_plan_4_8.xml#appendix
==> many of projects are below 1.8.

If it is important to you, to add the template, take some time and provide a fix for bug  95787. That would be welcome by many others, including myself ;-).
Comment 6 Lars Vogel CLA 2018-02-12 08:14:33 EST
(In reply to Dani Megert from comment #5)
> (In reply to Lars Vogel from comment #4)
> > Dani, Noopur, since 1-2 years SWT requires Java 8.
> 
> It is irrelevant what SWT requires. It is relevant what clients use. 

I think we should focus on supported Java versions and not unsupported ones. AFAIK Java 7 and lower are not supported anymore.

Projects which are in maintenance mode are less likely to create new code compared to new projects and new code would IMHO benefit from lambda based temmplates.