Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 334539

Summary: [celleditors] change listener
Product: z_Archived Reporter: Nicolas Bros <nicolas.bros>
Component: EMF-FacetAssignee: Nicolas Bros <nicolas.bros>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: emft.facet-inbox, gdupe
Version: unspecifiedFlags: nicolas.bros: indigo+
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 342832    
Attachments:
Description Flags
patch nicolas.bros: iplog+

Description Nicolas Bros CLA 2011-01-17 11:45:27 EST
In some cases, we need to be informed of each modification of the value in the cell editor, before receiving the "commit" event that only happens when the user hits enter or changes the focus.
For example, in dialogs extending JFace TitleAreaDialog, we want the error message to be updated in "real time".
Comment 1 Nicolas Bros CLA 2011-01-17 11:46:50 EST
I propose adding methods addChangeListener and addRemoveListener in org.eclipse.emf.facet.widgets.celleditors.IWidget to allow this.
Comment 2 Gregoire Dupe CLA 2011-04-14 12:59:37 EDT
Hello,

To fix this bug we have to:

 - Add an interface IWidget2 which is a copy of IWidget with four more methods:
	/** Add a listener for commit of the wigdet */
	void addCommitListener(IListener listener);

	/** Remove an existing listener */
	void removeCommitListener(IListener listener);

	/** Add a listener for change to the value */
	void addChangeListener(IListener listener);

	/** Remove an existing listener */
	void removeChangeListener(IListener listener);

        Where the IListener is a platform independant interfaces.

 - Modify the class org.eclipse.emf.facet.widgets.celleditors.AbstractCellEditorComposite<T> to:
  * implement IWidget2.
  * Add a fireChanged

 - Modify all the sub classes of AbstractCellEditorComposite to implement the change notification behavior.

Regards,
Gregoire
Comment 3 Nicolas Bros CLA 2011-04-20 04:32:45 EDT
Created attachment 193666 [details]
patch
Comment 4 Nicolas Bros CLA 2011-04-20 04:33:46 EDT
Done in revision 531.
Comment 5 Gregoire Dupe CLA 2011-06-08 10:08:17 EDT
This bug can be closed.