[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: Get selected EObjects from EcoreDiagramEditor

Ed,

first of all thank you very much for your fast reply!

> Philip,
> 
> Comments below.
> 
> Philip Langer wrote:
>> I'm not sure if I'm posting this to the right group. If not, please
>> excuse me.
>>
>> I've got two questions about EMF/GMF Editors, especially
>> EcoreDiagramEditors and EcoreEditors:
>>   
> I'm not exactly sure what you're referring to?  The editors for editing
> *.ecore resources?
>> 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.

In the question about getting selected EObjects I was referring to the 
org.eclipse.emf.ecoretools.diagram.part.EcoreDiagramEditor which, 
unfortunately, does not implement the ISelectionProvider. For generated 
Ecore editors using this provider works perfectly. But, how can I get the 
EObjects which are selected in the diagram displayed by an 
EcoreDiagramEditor?

>> 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.

Thanks for this hint! I'll change my implementation to make use of the 
command framework.

>> Thank you very much in advance,
>>
>> Philip Langer
>>