Community
Participate
Working Groups
Build Identifier: 20110615-0604 If a CDateTimeCellEditor is used as the editor in an EdtiSupport implementation the selection is not passed on if the drop down is activated, as the editor loses focus. The fix found was to override org.eclipse.jface.viewers.CellEditor#dependsOnExternalFocusListener() and have it return false (as was suggested in the javadoc). /* (non-Javadoc) * @see org.eclipse.jface.viewers.CellEditor#dependsOnExternalFocusListener() */ @Override protected boolean dependsOnExternalFocusListener() { //Prevent the popup from stealing focus. return false; } Reproducible: Always Steps to Reproduce: 1.Instantiate a table viewer table (may be the same for trees as well, not tested though). 2.Add a table viewer column, then add editing support the column. Have the editing support return a CDateTimeComboCellEditor as its cell editor. 3.Populate the table and launch the application. 4.Select a cell which would trigger the editor in question. Once the drop down button becomes visible, select it. The cell editor should now lose focus with the drop down visible. Subsequent selections are not propagated to the underlying object.
Reassigned as it was filed against wrong component.
Hi, since you have found a fix, can we close this? If not, please provide code that exposes the bug so that we can have a look.
I am having the same issue. Unfortunately the proposed fix introduces a new bug where the cell editor does not apply the value + deactivate in case the focus is lost. I think the best solution to the bug would be to change CDateTime so that it does not fire a focusLost event when it's text field loses focus to the graphical date selector. In the meantime, this should help to fix the additional issue: protected Control createControl(Composite parent) { final CDateTime cdt = (CDateTime) super.createControl(parent); cdt.addFocusListener(new FocusAdapter() { public void focusLost(FocusEvent e) { if (!cdt.isOpen()) { fireApplyEditorValue(); deactivate(); } } }); return cdt; }
The focus issue I mentioned was already reported as bug 287511.