| [news.eclipse.tools.emf] Re: Get selected EObjects from EcoreDiagramEditor |
Philip,
Comments below.
I'm not sure if I'm posting this to the right group. If not, please excuse me.I'm not exactly sure what you're referring to? The editors for editing *.ecore resources?
I've got two questions about EMF/GMF Editors, especially EcoreDiagramEditors and EcoreEditors:
First, I would like to get the EObjects which are currently selected in an active EcoreDiagramEditor. Is there a way of doing this?Editors generally provide a selection service you can use to determine the current selection. E.g., EMF generated editors implement ISelectionProvider.
Second, how can I set an EcoreEditor (tree editor) to dirty (leadings to the asterics in the tab) after changing its contents from outside programmatically.You must use commands to make changes.
I retrieved the selected EObjects using ISelectionProvider.getSelection and changed the objects. The changes are displayed in the editor immediately. But how can I set the editor to dirty from outside to force a "want to save"-question when closing.You must use the editor's command stack. IEditingDomainProvider provides access to it.
Thank you very much in advance,
Philip Langer