Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 334975 - [CellEditors] NPE Jface ColumnViewerEditor. fireApplyEditorValue() in doSetFocus()
Summary: [CellEditors] NPE Jface ColumnViewerEditor. fireApplyEditorValue() in doSetFo...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-21 01:37 EST by Quincy Mitchell CLA
Modified: 2019-08-10 15:55 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Quincy Mitchell CLA 2011-01-21 01:37:21 EST
Build Identifier: 

If you fireApplyEditorValue() in a doSetFocus() then you will always get a NPE.

My proposed fix is:

ColumnViewerEditor
[CODE]
	private boolean activateCellEditor(final ColumnViewerEditorActivationEvent activationEvent) {
....
cellEditor.setFocus();

				/*
				 * TODO
				 * MODIFIED HACK!
				 * 		if celleditor's doSetFocus()
				 * 		applies the value then the celleditor will turn null.
				 * 
				 *  see applyEditorValue() line 361. 
				 */
				if(!isCellEditorActive()){
					return true;
				}
				
				if (cellEditor.dependsOnExternalFocusListener()) {
....
[/CODE]

Reproducible: Always
Comment 1 Quincy Mitchell CLA 2011-01-22 01:22:45 EST
ok so the scenario... i have a table which i attach a celleditor.  I want the celleditor to be a dialog.  i want the user to be able to click a cell and a dialog immediately popup to view the contents of the row's model. then when ok is pressed then the changes are applied to the row's model.  if cancel is clicked then the row's model is unaffected.

basically i want the dialogcelleditor without its text cell editor.

so what i did was create my own celleditor similar to the dialogcelleditor.
however when setfocus happens, it opens the dialog then applies the celleditorsvalue and then returns from setfocus.

however the jface platform assumes that the celleditor will exist after the setfocus has been done.  this is incorrect because when i apply the celleditor's value the celleditor will be made null.
Comment 2 Eclipse Genie CLA 2019-08-10 15:55:31 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.