This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 431115 - DebugOptions are not updated for a specific trace option unless focus is changed from input field
Summary: DebugOptions are not updated for a specific trace option unless focus is chan...
Status: CLOSED DUPLICATE of bug 230398
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: 4.4 M7   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-25 10:10 EDT by Thomas Watson CLA
Modified: 2014-03-26 10:18 EDT (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 Thomas Watson CLA 2014-03-25 10:10:08 EDT
Perhaps Mac specific, I have not tried on other platforms

If you are making a change to a boolean trace option on the Mac focus is changed to the input field with a drop down box to select 'true' | 'false'.  If you change the boolean value to be different than before but do not click anything other than  'Apply' or 'OK' then the there is no call to org.eclipse.ui.trace.internal.datamodel.ModifiedDebugOptions.addDebugOption(TracingComponentDebugOption) to record the option change.  As a result the DebugOptions are not updated successfully with the changed option.

On the other hand, if before clicking 'Apply' or 'OK' you change the focus off the input field for the boolean option then the org.eclipse.ui.trace.internal.datamodel.ModifiedDebugOptions.addDebugOption(TracingComponentDebugOption) method is called as expected.
Comment 1 Curtis Windatt CLA 2014-03-25 10:59:11 EDT
On Windows, the editor value is not applied when the combo is changed.  However, when ok or apply is pressed, the value is applied (event sent) and the change recognized.

Moving to Platform UI for comment as it looks like we get no call to EditingSupport.setValue().  I can try to confirm on a Mac if needed.
Comment 2 Brian de Alwis CLA 2014-03-25 17:38:48 EDT
For clarity, to reproduce:

1. Open Window > Preferences > General > Tracing
2. Enable tracing
3. Select some boolean tracing value, click on the value column and use the mouse to select a different value.
4. Click OK.  Note that the value field does not lose focus.

Interesting problem!  On OS X, clicking on the OK or Apply buttons in the Preferences dialog doesn't actually cause a focus change: the button is triggered, but the focus remains on the original widget.

This lack of a focus change throws a wrench into how ComboBoxCellEditor propagates cell-editor-change events.  The ComboBoxCellEditor sets up several events on its underlying CCombo —- focusLost, widgetDefaultSelected, and some key-presses —- to trigger a editor-value-changed event via the method applyEditorValueAndDeactivate().  It's one of these editor-value-changed listeners that leads to the addDebugOption() being called; it also leads to the cell-editor being deactivated.  The code doesn't trigger applyEditorValueAndDeactivate() from the CCombo's widgetSelected() as widgetSelected() is called both on mouse-driven selection (which causes the CCombo's drop-down list to disappear) as well as when using key-arrow-up and key-arrow-down to select between values (which keeps the CCombo's drop-down list visible).  So short of a focus-change, we have no other way to know if the user has actually selected a value.

I think a fix would be to have the widgetSelected() event check whether the CCombo's drop-down list is still visible via CCombob#getListVisible().  If not, then the user selected a value and applyEditorValueAndDeactivate() can be called.  This seems to work well in my testing.  It has one side-effect that if the user selects a value from the combo list, the CCombo's text field is no longer shown as being editable as the cell editor is deactivated; this is identical to the behaviour when selecting a value from the combo list  with "enter".
Comment 3 Brian de Alwis CLA 2014-03-26 10:18:42 EDT
Ah, searchig through the bugs, I think this is the same issue as 230398.

*** This bug has been marked as a duplicate of bug 230398 ***