Package: RefresherAdapter
RefresherAdapter
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
RefresherAdapter(TableViewer) |
|
|
|
|
|
||||||||||||||||||||
notifyChanged(Notification) |
|
|
|
|
|
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: }