Skip to content

Package: RefresherAdapter

RefresherAdapter

nameinstructionbranchcomplexitylinemethod
RefresherAdapter(TableViewer)
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: 32 C: 0
0%
M: 14 C: 0
0%
M: 8 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%

Coverage

1: package org.eclipse.egf.pattern.ui.editors.adapter;
2:
3: import org.eclipse.emf.common.notify.Notification;
4: import org.eclipse.emf.common.notify.impl.AdapterImpl;
5: import org.eclipse.emf.ecore.EAttribute;
6: import org.eclipse.jface.viewers.TableViewer;
7:
8: public class RefresherAdapter extends AdapterImpl {
9:
10: private TableViewer tableViewer;
11:
12: public RefresherAdapter(TableViewer tableViewer) {
13: this.tableViewer = tableViewer;
14: }
15:
16: @Override
17: public void notifyChanged(org.eclipse.emf.common.notify.Notification msg) {
18:• if (msg.isTouch()) {
19: return;
20: }
21:• if (msg.getFeature() instanceof EAttribute && (msg.getEventType() == Notification.SET || msg.getEventType() == Notification.UNSET)) {
22:• if (tableViewer != null && tableViewer.getTable() != null && !tableViewer.getTable().isDisposed()) {
23: tableViewer.refresh();
24: }
25: }
26: }
27:
28: }