[EEF] Update editor when semantic element change [message #667351] |
Thu, 28 April 2011 09:21 |
Xavier Seignard Messages: 52 Registered: June 2010 |
Member |
|
|
Hello,
I would like to display (or not) some parts of my editor given the value of a semantic element.
Ex : Imagine an EClass Definition with two EAttributes Type and Unit.
If Type equals String I don't want to display the field Unit in my editor.
To do so, I extended the XXXPropertiesEditionPartImpl and overidden the createControls method in order to provide the behavior I want by modifying the CompositionSequence of the composer.
It works quite well except that the editor is not dynamically updated when I change the value of my semantic element. I need to display another file or close the editor and open it again to see the semantic change reflected in my editor (because createControls is called again).
Now I would like to do it dynamically, so I assume I need to override the createXXXEMFComboViewer (in my case) in order to add a ISelectionChangedListener which will update the editor during the call of selectionChanged. Am I right? Is it the right way to do it?
The problem is I can't figure out how to update the editor. Do you have any idea?
Have a good day,
Regards,
Xavier Seignard
[Updated on: Thu, 28 April 2011 09:25] Report message to a moderator
|
|
|
Re: [EEF] Update editor when semantic element change [message #667410 is a reply to message #667351] |
Thu, 28 April 2011 14:43 |
Nathalie Lepine Messages: 28 Registered: July 2009 |
Junior Member |
|
|
Hello,
Do dynamically update the view, you need to change the
"updateSemanticModel" method of the component using the composer and the
composition sequence. For example : this code change the visibility of
the first widget each time the value of my combo changes :
((CompositePropertiesEditionPart)editingPart).getComposer(). getCompositionSequence().getSubSteps().get(0).getSubSteps(). get(0).switchVisibilty();((CompositePropertiesEditionPart)ed itingPart).refresh();
initPart(partKey, 0, this.semanticObject);
Regards,
Nathalie Lepine.
Le 28/04/2011 11:21, Xavier Seignard a écrit :
> Hello,
> I would like to display (or not) some parts of my editor given the value
> of a semantic element.
>
> Ex : Imagine an EClass Definition with two EAttributes Type and Unit. If
> Type equals String I don't want to display the field Unit in my editor.
>
> To do so, I extended the XXXPropertiesEditionPartImpl and overidden the
> createControls method in order to provide the behavior I want by
> modifying the CompositionSequence of the composer.
>
> It works quite well except that the editor is not dynamically updated
> when I change the value of my semantic element. I need to display
> another file or close the editor and open it again to see the semantic
> change reflected in my editor (because createControls is called again).
>
> Now I would like to do it dynamically, so I assume I need to override
> the createXXXEMFComboViewer (in my case) in order to add a
> ISelectionChangedListener which will update the editor during the call
> of selectionChanged. Am I right? Is it the right way to do it?
>
> The problem is I can't figure out how to update the editor. Do you have
> any idea?
>
> Have a good day,
>
> Regards,
>
> Xavier Seignard
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03247 seconds