| Summary: | Pressing enter calls the @Focus Method | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Lars Vogel <Lars.Vogel> | ||||
| Component: | UI | Assignee: | Eric Moffatt <emoffatt> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | critical | ||||||
| Priority: | P3 | CC: | emoffatt, jpetrakis, Lars.Vogel, mailings, nobody, pwebster, t.s.maeder, tom.schindl | ||||
| Version: | 4.2 | ||||||
| Target Milestone: | 4.2.2 | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
This only happens in 421 and not in 42? Moreover if there's no @Focus method it breaks spectacularly. I think http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=R4_2_maintenance&id=7e4f7fe862a8927af779392e2478906c30695916 introduced this regression. Created attachment 221782 [details]
Proposed fix
Patch
http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=R4_2_maintenance&id=d609fcbea6e6a33dd8213befd7e9553a8af9d954 Applied the patch ! Thanks guys... BTW, sorry Sopot but I keep forgetting to change the 'Author' field when doing my commits...I'll try to get better at this Marking as FIXED... Really this time ;-) @Eric, you can use git --amend (also available in EGit) to change the last commit, e.g. to change the author of the patch. (In reply to comment #5) > http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/ > ?h=R4_2_maintenance&id=d609fcbea6e6a33dd8213befd7e9553a8af9d954 > > Applied the patch ! Thanks guys... > > BTW, sorry Sopot but I keep forgetting to change the 'Author' field when > doing my commits...I'll try to get better at this Np *** Bug 392150 has been marked as a duplicate of this bug. *** *** Bug 391830 has been marked as a duplicate of this bug. *** Verified in M20130124-1700. |
I think we have a regression in Eclipse 4.2.1. If I define a user interface and press [ENTER] in a text field the @Focus method is called. Example: Create the following part and press enter in one of the Text fields, e.g. the one defined with SWT.MULTI Let me know if you need a complete example, I can upload one. -------------- package com.example.e4.rcp.ui.parts; import javax.annotation.PostConstruct; import org.eclipse.e4.ui.di.Focus; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.DateTime; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; public class TodoDetailsPart { private Text text; private Text text_1; private Text text_2; private DateTime dateTime; private Button btnClickMe; private Label lblNewLabel_2; @PostConstruct public void buildUi(Composite parent) { parent.setLayout(new GridLayout(2, false)); Label lblSummary = new Label(parent, SWT.NONE); lblSummary.setText("Summary"); text = new Text(parent, SWT.BORDER); text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); new Label(parent, SWT.NONE); lblNewLabel_2 = new Label(parent, SWT.NONE); lblNewLabel_2.setText("New Label"); Label lblNewLabel = new Label(parent, SWT.NONE); lblNewLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); lblNewLabel.setText("Description"); text_1 = new Text(parent, SWT.BORDER| SWT.MULTI); GridData gd_text_1 = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); gd_text_1.heightHint = 92; text_1.setLayoutData(gd_text_1); Label lblNewLabel_1 = new Label(parent, SWT.NONE); lblNewLabel_1.setText("Stuff"); text_2 = new Text(parent, SWT.BORDER); text_2.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1)); new Label(parent, SWT.NONE); dateTime = new DateTime(parent, SWT.BORDER); btnClickMe = new Button(parent, SWT.CHECK); btnClickMe.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { } }); btnClickMe.setText("Click me"); new Label(parent, SWT.NONE); } @Focus public void focus() { btnClickMe.setFocus(); } }