Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344998 - Editor Should Generate code for selection change listeners on EEFPropertiesViewerMDFormPage contributed
Summary: Editor Should Generate code for selection change listeners on EEFPropertiesVi...
Status: CLOSED WONTFIX
Alias: None
Product: EEF
Classification: Modeling
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 enhancement
Target Milestone: ---   Edit
Assignee: EEF Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-06 12:25 EDT by Romain Guider CLA
Modified: 2016-05-30 09:53 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Romain Guider CLA 2011-05-06 12:25:56 EDT
Build Identifier: 0.9.0.v20110414-0605

When an EEF generated editor has contributions of the type EEFPropertiesViewerMDFormPage, no code is generated to add a listener on the change of selection. 

A quick and dirty fix as follows: 
override the EEFPropertiesViewerMDFormPage.refreshFormContents, reproduce the code that's in it and add some code that sets the editor's selection in the propertiesChangedListener :

						protected void refreshFormContents() {
							PropertiesEditionContentProvider contentProvider = new PropertiesEditionContentProvider(
									getAdapterFactory(), IPropertiesEditionComponent.LIVE_MODE, editingDomain);
							getModelViewer().setContentProvider(contentProvider);
							contentProvider.addPropertiesListener(new IPropertiesEditionListener() {

								public void firePropertiesChanged(IPropertiesEditionEvent event) {
									if (event.getState() == PropertiesEditionEvent.CHANGE
											&& event.getKind() == PropertiesEditionEvent.SELECTION_CHANGED
											&& isAffectingEditor(event)) {
										getManagedForm().fireSelectionChanged(block.getMasterPart(),
												new StructuredSelection(event.getNewValue()));
										Object[] selected = new Object[1];
										selected[0] = event.getNewValue();
										ISelection selection = new StructuredSelection(selected);
										XYZEditor.this.setSelection(selection);
									}
								}
							});
							block.setAdapterFactory(adapterFactory);
							block.setEditingDomain(editingDomain);
							block.setInput(input);

						}


Reproducible: Always

Steps to Reproduce:
1. Generate a Master detail EEF Editor that has a page with a EEFPropertiesViewerMDFormPage
2. run
3.
Comment 1 Goulwen Le Fur CLA 2011-05-13 06:02:26 EDT
This is an enhancement
Comment 2 Stephane Begaudeau CLA 2016-05-30 09:53:29 EDT
The Eclipse EEF team has worked over the past few months on a brand new runtime using a reflective approach which can be used more easily with Eclipse Sirius. Since we do not plan to continue to work on the old runtime and its code generation approach, I will close this issue for now.

If you want to contribute, you can reopen this issue and submit a contribution to the project thanks to our Gerrit: https://git.eclipse.org/r/#/admin/projects/eef/org.eclipse.eef