|
Re: Capture the attribute change event [message #640036 is a reply to message #552809] |
Thu, 18 November 2010 18:37 |
Carlos Messages: 16 Registered: July 2009 |
Junior Member |
|
|
Hi there,
In my GMF editor, I add/remove affixed children when I modify a property of the object.
To do this, I override method "handleNotificationEvent" in the XXXEditPart.java file.
For example, if you have an object called MyObject with an attribute called MyAttribute, the code would be something like this:
/**
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#handlePropertyChangeEvent(java.beans.PropertyChangeEvent)
*/
protected void handleNotificationEvent(Notification notification)
{
Object feature = notification.getFeature();
if (notification.getFeature() instanceof EAttributeImpl
&& notification.getFeatureID(MyObject.class) == MyEditorPackage.MYOBJECT_MYATTRIBUTE)
{
// Place your code here
}
else
{
super.handleNotificationEvent(notification);
}
}
Hope it helps
Carlos
[Updated on: Thu, 18 November 2010 18:39] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03012 seconds