Runtime

org.eclipse.gmf.runtime.diagram.core.listener
Class NotificationUtil

java.lang.Object
  extended by org.eclipse.gmf.runtime.diagram.core.listener.NotificationUtil

public class NotificationUtil
extends java.lang.Object

Utility class that implements few helper methods around the EMF Notification object


Constructor Summary
NotificationUtil()
           
 
Method Summary
static java.util.Set getAddedObjects(ResourceSetChangeEvent event)
          Collect the added objects from all the notifications in the event.
static java.util.Set getDeletedObjects(ResourceSetChangeEvent event)
          Collect the deleted objects from all the notifications in the event.
static boolean isCustomNotification(Notification notification)
          checks if the Notification is a custom notification or not
static boolean isElementAddedToSlot(Notification notification)
          checks if the event resulted in adding an element
static boolean isElementRemovedFromSlot(Notification notification)
          checks if the event resulted in removing an element
static boolean isMove(Notification notification)
          checks if the event is an Notification.MOVE event.
static boolean isSlotModified(Notification notification)
          checks if the event resulted in a slot modification (set/unset event)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotificationUtil

public NotificationUtil()
Method Detail

isSlotModified

public static boolean isSlotModified(Notification notification)
checks if the event resulted in a slot modification (set/unset event)

Returns:
true if the event type is one of Notification.SET or Notification.UNSET; otherwise false.

isElementAddedToSlot

public static boolean isElementAddedToSlot(Notification notification)
checks if the event resulted in adding an element

Returns:
true if the event type is one of Notification.ADD or Notification.ADD_MANY; otherwise false.

isElementRemovedFromSlot

public static boolean isElementRemovedFromSlot(Notification notification)
checks if the event resulted in removing an element

Returns:
true if the event type is one of Notification.REMOVE or Notification.REMOVE_MANY; otherwise false.

isMove

public static boolean isMove(Notification notification)
checks if the event is an Notification.MOVE event.

Returns:
true if the event type equals Notification.MOVE; otherwise false.

isCustomNotification

public static boolean isCustomNotification(Notification notification)
checks if the Notification is a custom notification or not

Returns:
true if the noptificatio is custom notification otherwise false.

getDeletedObjects

public static java.util.Set getDeletedObjects(ResourceSetChangeEvent event)
Collect the deleted objects from all the notifications in the event.

Parameters:
event -
Returns:

getAddedObjects

public static java.util.Set getAddedObjects(ResourceSetChangeEvent event)
Collect the added objects from all the notifications in the event.

Parameters:
event -
Returns:
Set contains all added objects

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.