Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » How to impact the notification refresh value(EMF edit item provider does not have content refresh for all refrences)
How to impact the notification refresh value [message #899377] Tue, 31 July 2012 15:42 Go to next message
Yigal Spinner is currently offline Yigal Spinner
Messages: 102
Registered: July 2009
Senior Member
I have a large model and many of the classes are referenced as containment or association.
When I generate the EDIT code not all references appear in the notification.
Because of that the tree in the editor does not refresh when a reference to association is changed. Only contained references are refresh.

For example: one of the classes generated the following which is only the contained refernces

public void notifyChanged(Notification notification) {
updateChildren(notification);

switch (notification.getFeatureID(InterfaceEntity.class)) {
case FSDModelPackage.INTERFACE_ENTITY__INTERFACE_TYPE:
case FSDModelPackage.INTERFACE_ENTITY__RELATED_MAPPPER_NAMES:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case FSDModelPackage.INTERFACE_ENTITY__INTERFACE_MESSAGE_MAPPER:
case FSDModelPackage.INTERFACE_ENTITY__INTERFACE_SERVICE_CALLS:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
return;
}
super.notifyChanged(notification);
}


I would expect it to generate all the references like this:
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);

switch (notification.getFeatureID(InterfaceEntity.class)) {
case FSDModelPackage.INTERFACE_ENTITY__INTERFACE_TYPE:
case FSDModelPackage.INTERFACE_ENTITY__RELATED_MAPPPER_NAMES:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case FSDModelPackage.INTERFACE_ENTITY__INTERFACE_MESSAGE_MAPPER:
case FSDModelPackage.INTERFACE_ENTITY__INTERFACE_SERVICE_CALLS:
case FSDModelPackage.INTERFACE_ENTITY__ICD:
case FSDModelPackage.INTERFACE_ENTITY__INTERFACE_MESSAGE:
case FSDModelPackage.INTERFACE_ENTITY__OPERATION:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
return;
}
super.notifyChanged(notification);
}

How can I control this list to make sure ALL references are in it?

I know I can change the notify property in the genmodel but that will add the reference to the label update and not the viewer update list.
I want to have the viewer content change.

[Updated on: Tue, 31 July 2012 15:58]

Report message to a moderator

Re: How to impact the notification refresh value [message #899431 is a reply to message #899377] Tue, 31 July 2012 19:01 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26054
Registered: July 2009
Senior Member
Yigal,

Comments below.

On 31/07/2012 5:42 PM, Yigal Spinner wrote:
> I have a large model and many of the classes are referenced as
> containment or association.
> When I generate the EDIT code not all references appear in the
> notification.
That depends on what you've set for the properties of the corresponding
GenFeatures...
> Because of that the tree in the editor does not refresh when a
> reference to association is changed. Only contained references are
> refresh.
>
> For example: one of the classes generated the following which is only
> the contained refernces
>
> public void notifyChanged(Notification notification) {
> updateChildren(notification);
>
> switch (notification.getFeatureID(InterfaceEntity.class)) {
> case FSDModelPackage.INTERFACE_ENTITY__INTERFACE_TYPE:
> case FSDModelPackage.INTERFACE_ENTITY__RELATED_MAPPPER_NAMES:
> fireNotifyChanged(new ViewerNotification(notification,
> notification.getNotifier(), false, true));
> return;
> case
> FSDModelPackage.INTERFACE_ENTITY__INTERFACE_MESSAGE_MAPPER:
> case
> FSDModelPackage.INTERFACE_ENTITY__INTERFACE_SERVICE_CALLS:
> fireNotifyChanged(new ViewerNotification(notification,
> notification.getNotifier(), true, false));
> return;
> }
> super.notifyChanged(notification);
> }
>
>
> I would expect it to generate all the references like this:
> @Override
> public void notifyChanged(Notification notification) {
> updateChildren(notification);
>
> switch (notification.getFeatureID(InterfaceEntity.class)) {
> case FSDModelPackage.INTERFACE_ENTITY__INTERFACE_TYPE:
> case FSDModelPackage.INTERFACE_ENTITY__RELATED_MAPPPER_NAMES:
> fireNotifyChanged(new ViewerNotification(notification,
> notification.getNotifier(), false, true));
> return;
> case
> FSDModelPackage.INTERFACE_ENTITY__INTERFACE_MESSAGE_MAPPER:
> case
> FSDModelPackage.INTERFACE_ENTITY__INTERFACE_SERVICE_CALLS:
> case FSDModelPackage.INTERFACE_ENTITY__ICD:
> case FSDModelPackage.INTERFACE_ENTITY__INTERFACE_MESSAGE:
> case FSDModelPackage.INTERFACE_ENTITY__OPERATION:
> fireNotifyChanged(new ViewerNotification(notification,
> notification.getNotifier(), true, false));
> return;
> }
> super.notifyChanged(notification);
> }
>
> How can I control this list to make sure ALL references are in it?
Set the Notify property of each GenFeature to true.
Re: How to impact the notification refresh value [message #899440 is a reply to message #899431] Tue, 31 July 2012 19:55 Go to previous messageGo to next message
Yigal Spinner is currently offline Yigal Spinner
Messages: 102
Registered: July 2009
Senior Member
Since my model is huge and there is a lot of manual work, I'll like to make it programmatic.
I know how to open the genmodel as a resource and get to the genPackage.
How do I get from the gen package to notify element in the edit section?

I tested you Notify change and it works great.


Thanks
Yigal
Re: How to impact the notification refresh value [message #899442 is a reply to message #899440] Tue, 31 July 2012 20:23 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26054
Registered: July 2009
Senior Member
Yigal,

Comments below.

On 31/07/2012 9:55 PM, Yigal Spinner wrote:
> Since my model is huge and there is a lot of manual work, I'll like to
> make it programmatic.
> I know how to open the genmodel as a resource and get to the genPackage.
> How do I get from the gen package to notify element in the edit section?
GenPackages contains GenClassifiers, some of which are GenClasses that
contain GenFeatures. This containment structure should be apparent
looking at the tree view in the Generator.
>
> I tested you Notify change and it works great.
>
>
> Thanks
> Yigal
>
Previous Topic:[CDO] Productive Use and Schema Evolution
Next Topic:[CDO] Edapt and CDO model migration
Goto Forum:
  


Current Time: Sat Sep 20 22:22:36 GMT 2014

Powered by FUDForum. Page generated in 0.17348 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software