Skip to content

Package: NotificationReceiver

NotificationReceiver

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2015 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * jfaltermeier - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.changebroker.spi;
15:
16: import org.eclipse.emf.common.notify.Notification;
17: import org.eclipse.emf.ecore.EObject;
18:
19: /**
20: * A target for new notifications.
21: *
22: * @author jfaltermeier
23: *
24: */
25: public interface NotificationReceiver {
26:
27:         /**
28:          * Called whenever there is a new {@link Notification} meant for the receiver.
29:          *
30:          * @param notification the notification
31:          */
32:         void notify(Notification notification);
33:
34:         /**
35:          * Called before an element gets deleted, after all {@link VetoableDeleteObserver} have returned true and therefore
36:          * the delete operation is allowed.
37:          *
38:          * @param toBeDeleted The {@link EObject} to be deleted
39:          * @since 1.7
40:          */
41:         void notifyPreDelete(EObject toBeDeleted);
42:
43:         /**
44:          * Called after an element was deleted.
45:          *
46:          * @param toBeDeleted The {@link EObject} to be deleted
47:          * @since 1.7
48:          */
49:         void notifyPostDelete(EObject toBeDeleted);
50:
51:         /**
52:          * @param toBeDeleted The {@link EObject} to be deleted
53:          * @return If all {@link VetoableDeleteObserver} return true and therefore allow the delete operation.
54:          * @since 1.7
55:          */
56:         boolean canDelete(EObject toBeDeleted);
57:
58: }