Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357593 - [Table] Table takes focus after each refresh
Summary: [Table] Table takes focus after each refresh
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EMF-Facet (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 major (vote)
Target Milestone: ---   Edit
Assignee: Nicolas Bros CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 355880
  Show dependency tree
 
Reported: 2011-09-14 03:12 EDT by Vincent Lorenzo CLA
Modified: 2020-05-01 11:27 EDT (History)
4 users (show)

See Also:
gdupe: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent Lorenzo CLA 2011-09-14 03:12:46 EDT
Comes from the Papyrus bug bug 355880, but I can reproduce this bug using only EMF-Facet Nattable (as described below).
The table take the focus after each refresh. I think this problem comes from the method NatTableWidget.setInput() because this method finishs with this.natTable.setFocus(); If I comment this last step I don't have the problem.

Step to reproduce : 
	1/ Create a new Ecore model
	2/ Edit an element of this model in a TableEditor
	3/Share your screen between the Ecore Editor and the TableEditor
	4/ Modify your model in the Ecore Editor (add an element, or rename an element in the property view
	-> The table is refreshed (OK) and take the focus, whenever it shouldn't.

+ As noticed in the bug 355880, the table is refresh even if an element which is not in the table is modified.
Comment 1 Nicolas Bros CLA 2011-10-10 04:16:10 EDT
Fixed in revision 957 in trunk and revision 958 in branch 0_1.
I have modified the setInput method of NatTableWidget so that the table control only retakes focus if it had it before the table was "refreshed" (i.e. recreated) or the first time it is created.
Comment 2 Nicolas Bros CLA 2011-10-10 04:22:44 EDT
Note: I have found the setFocus() call is useful when manipulating the table using the keyboard :
- hit F2 on an editable cell
- modify the contents
- hit Enter
- move to another cell using the arrow keys

Without the call to setFocus() in setInput(), this last step does not work because the table control has lost focus when it was destroyed and then recreated.
Comment 3 Gregoire Dupe CLA 2011-10-10 07:30:23 EDT
(In reply to comment #2)
> Without the call to setFocus() in setInput(), this last step does not work
> because the table control has lost focus when it was destroyed and then
> recreated.

Then, this be can't be considered has fixed.
Comment 4 Gregoire Dupe CLA 2011-10-10 07:54:51 EDT
(In reply to comment #3)
> (In reply to comment #2)
> > Without the call to setFocus() in setInput(), this last step does not work
> > because the table control has lost focus when it was destroyed and then
> > recreated.
> 
> Then, this be can't be considered has fixed.

Ok, so after an off line explanation this is not a regression.
Comment 5 Gregoire Dupe CLA 2012-05-23 08:44:02 EDT
Hello Vincent,

Please, can you close this bug, if your problem has been solved ?

Regards,
Grégoire
Comment 6 Vincent Lorenzo CLA 2012-10-09 10:26:28 EDT
This bug can be marked as closed fixed.