Bug 498748 - Enter text in an EEF Text widget can be painful due to too short validation time of the widget
Summary: Enter text in an EEF Text widget can be painful due to too short validation t...
Status: VERIFIED FIXED
Alias: None
Product: EEF
Classification: Modeling
Component: Core (show other bugs)
Version: 1.6.0   Edit
Hardware: PC All
: P3 critical
Target Milestone: 1.8.0   Edit
Assignee: Project Inbox CLA
QA Contact: Julien Dupont CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-28 05:38 EDT by Goulwen Le Fur CLA
Modified: 2016-12-01 11:15 EST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Goulwen Le Fur CLA 2016-07-28 05:38:11 EDT
When entering text for a properties in a EEF Text Widget, if you stop during 500ms, EEF try to validate the current value of the widget to update the EObject.

If this value is valid, the EObject is updated otherwise the field is reinitialized with the preceding value.

This can be painful when you have to edit a lot of complex values in your metamodel.

A solution could be to validate the value when the focus is lost or to be able to configure the validation delay of the widget
Comment 1 Eclipse Genie CLA 2016-09-12 04:48:08 EDT
New Gerrit change created: https://git.eclipse.org/r/80894
Comment 2 Stephane Begaudeau CLA 2016-09-12 04:52:43 EDT
I have pushed a review on Gerrit changing the way the modification of a text field is performed. This review triggers the modification on the loss of the focus of the text field instead of waiting a bit.

This modification may not be integrated (or even integrated as is) in EEF but at least with this review we can have a look at how this change could be made and what it would look like.
Comment 3 Pierre-Charles David CLA 2016-09-12 05:11:13 EDT
While not directly related to this issue on the outside, I had to jump through a few hoops in order to prototype a fix for #495036, see https://git.eclipse.org/r/#/c/80827/.

Basically, in that other ticket, we want to be able to revert the user's changes in the text field if the "direct edit" tool execution failed. Otherwise the visible text is out of synch with what is actually in the model. In the current implementation the tool execution is done asynchronously in a background thread, which makes the reversal a little complex (but possible). It looks like Stephane's proposed patch here would remove this asynchronous approach, and thus probably impact the other patch (for something simpler probably).
Comment 5 Eclipse Genie CLA 2016-09-19 10:14:34 EDT
New Gerrit change created: https://git.eclipse.org/r/81342
Comment 7 Arthur Daussy CLA 2016-09-21 11:18:40 EDT
With version
* Sirius 4.1.0.201609201603
* Eef:   1.7.0.201609191510

Setting the feature when the focus is lost introduces a bug when using multiple tab. Indeed the value entered by the user is discarded.

To reproduce:

 1. Edit a text widget
 2. Switch to a different tab
 3. Switch back to the first tab

The value the user has entered is lost and the feature has not been set.
Comment 8 Arthur Daussy CLA 2016-09-21 11:21:44 EDT
With version
* Sirius 4.1.0.201609201603
* Eef:   1.7.0.201609191510

Setting the feature when the focus is lost introduces a bug when using multiple tab. Indeed the value entered by the user is discarded.

To reproduce:

 1. Edit a text widget
 2. Switch to a different tab
 3. Switch back to the first tab

The value the user has entered is lost and the feature has not been set.
Comment 9 Eclipse Genie CLA 2016-09-22 04:20:05 EDT
New Gerrit change created: https://git.eclipse.org/r/81661
Comment 11 Eclipse Genie CLA 2016-09-27 09:25:09 EDT
New Gerrit change created: https://git.eclipse.org/r/81994
Comment 12 Eclipse Genie CLA 2016-09-27 10:58:23 EDT
New Gerrit change created: https://git.eclipse.org/r/81995
Comment 14 Eclipse Genie CLA 2016-11-02 04:45:53 EDT
New Gerrit change created: https://git.eclipse.org/r/84318
Comment 15 Pierre-Charles David CLA 2016-11-24 11:48:47 EST
See also https://git.eclipse.org/r/#/c/84319/ which "fixes" (more "works around") a potential NPE once https://git.eclipse.org/r/84318 is applied.

Steps to reproduce:
1. Open an Ecore Tools diagram and select an EClass.
2. In the 'Main' tab, change its name but do not validate the change (don't hit return, don't select another widget).
3. Click directly on the 'Base' tab.
4. Go back to the 'Main' tab => NPE

java.lang.NullPointerException
	at org.eclipse.eef.properties.ui.api.EEFTabbedPropertySheetPage.processSelectionChanged(EEFTabbedPropertySheetPage.java:500)
	at org.eclipse.eef.properties.ui.api.EEFTabbedPropertySheetPage.access$0(EEFTabbedPropertySheetPage.java:479)
	at org.eclipse.eef.properties.ui.api.EEFTabbedPropertySheetPage$1.selectionChanged(EEFTabbedPropertySheetPage.java:206)
Comment 16 Pierre-Charles David CLA 2016-11-24 11:50:28 EST
There are actually unresolved issues with the new behavior. I'm reopening this one for now, but we may decide to close it and open other tickets for the specific issues left.
Comment 19 Pierre-Charles David CLA 2016-12-01 04:02:40 EST
I believe all currently known issues are now fixed. If others appear, please open other, more specific tickets.