Skip to content

Package: TestViewContentAdapter

TestViewContentAdapter

nameinstructionbranchcomplexitylinemethod
TestViewContentAdapter(List)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
notifyChanged(Notification)
M: 26 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2013 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: * Edgar - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.rule.test;
15:
16: import java.util.List;
17:
18: import org.eclipse.emf.common.notify.Notification;
19: import org.eclipse.emf.ecore.util.EContentAdapter;
20: import org.eclipse.emf.ecp.view.spi.model.ModelChangeAddRemoveListener;
21: import org.eclipse.emf.ecp.view.spi.model.ModelChangeNotification;
22:
23: /**
24: * @author Edgar
25: *
26: */
27: public class TestViewContentAdapter extends EContentAdapter {
28:
29:         private final List<ModelChangeAddRemoveListener> viewChangeListeners;
30:
31:         public TestViewContentAdapter(List<ModelChangeAddRemoveListener> listeners) {
32:                 viewChangeListeners = listeners;
33:         }
34:
35:         @Override
36:         public void notifyChanged(Notification notification) {
37:
38:                 super.notifyChanged(notification);
39:
40:•                if (notification.isTouch()) {
41:                         return;
42:                 }
43:
44:•                for (final ModelChangeAddRemoveListener listener : viewChangeListeners) {
45:                         listener.notifyChange(new ModelChangeNotification(notification));
46:                 }
47:         }
48: }