List of EMF Notification event types (event type name – int)

Just a very quick post today, which will hopefully be useful to someone other than myself as well.

When using the org.eclipse.emf.common.notify.Notification interface in Eclipse GEF editors, more precisely in any extensions of Adapter or EContentAdapter (cf. respective tutorial at vogella.com) you use in EditParts, you may want to catch certain event types in your Adapter‘s notifyChanged() method.

In my case, I have an Adapter listen to model elements, and want to implement a switch statement for certain event types. I’m able to get the event type in the method via notification.getEventType() and print that to, say, System.out1, but this only gives me an int value. To be able to quickly implement the switch case for this event type, I thought it would be useful to have a list of event types and their corresponding int values. So here it is (one ordered alphabetically, and another one ordered by int value).

▼ Event type int value
ADD 3
ADD_MANY 5
CREATE (Deprecated) 0
EVENT_TYPE_COUNT 10
MOVE 7
NO_FEATURE_ID -1
NO_INDEX -1
REMOVE 4
REMOVE_MANY 6
REMOVING_ADAPTER 8
RESOLVE 9
SET 1
UNSET 2
▼ int value Event type
-1 NO_FEATURE_ID
-1 NO_INDEX
0 CREATE (Deprecated)
1 SET
2 UNSET
3 ADD
4 REMOVE
5 ADD_MANY
6 REMOVE_MANY
7 MOVE
8 REMOVING_ADAPTER
9 RESOLVE
10 EVENT_TYPE_COUNT
TwitterFacebookGoogle+EmailLinkedInPinterestDiggRedditStumbleUpon
If you found this post helpful, you may want to consider donating to help cover server costs.
Tagged with: , , , , , , , , , , , ,
Posted in Eclipse RCP, EMF: Eclipse Modeling Framework, GEF: Eclipse Graphical Editing Framework, Resources

Leave a Comment

%d bloggers like this: