if (arg instanceof ObserverNotification) {
final ObserverNotification notification = (ObserverNotification) arg;
final NotificationType type = notification.getType();
try {
if (type.equals(NotificationType.loadFromFile)) {
final PersistenceProviderInterface plugin = (PersistenceProviderInterface) notification.getObj1();
final Collection<?> items = (Collection<?>) notification.getObj2();
if (this == plugin) {
loadFromFile(items);
}
} else if (type.equals(NotificationType.clearModel)) {
final PersistenceProviderInterface plugin = (PersistenceProviderInterface) notification.getObj1();
if (this == plugin) {
clearModel();
}
}
if (type.equals(NotificationType.saveToFile)) {
final PersistenceProviderInterface plugin = (PersistenceProviderInterface) notification.getObj1();
@SuppressWarnings("unchecked")
final Collection<Object> items = (Collection<Object>) notification.getObj2();
if (this == plugin) {
saveToFile(items);
}