How to impact the notification refresh value [message #899377] |
Tue, 31 July 2012 15:42 |
Yigal Spinner Messages: 127 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 |
Ed Merks Messages: 33142 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.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Re: How to impact the notification refresh value [message #899442 is a reply to message #899440] |
Tue, 31 July 2012 20:23 |
Ed Merks Messages: 33142 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
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03086 seconds