1 17 package org.eclipse.emf.edit.provider; 18 19 20 import org.eclipse.emf.common.notify.Notification; 21 import org.eclipse.emf.common.notify.NotificationWrapper; 22 23 24 28 public class ViewerNotification extends NotificationWrapper implements IViewerNotification 29 { 30 36 public static Notification wrapNotification(Notification notification, Object element) 37 { 38 if (notification instanceof IViewerNotification) 39 { 40 return new ViewerNotification((IViewerNotification)notification, element); 41 } 42 return new NotificationWrapper(element, notification); 43 } 44 45 49 protected Object element; 50 51 55 protected boolean contentRefresh; 56 57 61 protected boolean labelUpdate; 62 63 66 public ViewerNotification(Notification decoratedNotification) 67 { 68 this(decoratedNotification, null, true, true); 69 } 70 71 74 public ViewerNotification(Notification decoratedNotification, Object element) 75 { 76 this(decoratedNotification, element, true, true); 77 } 78 79 82 public ViewerNotification(Notification decoratedNotification, Object element, boolean contentRefresh, boolean labelUpdate) 83 { 84 super(decoratedNotification); 85 this.element = element; 86 this.contentRefresh = contentRefresh; 87 this.labelUpdate = labelUpdate; 88 } 89 90 93 public ViewerNotification(IViewerNotification viewerNotification, Object element) 94 { 95 this(viewerNotification, element, viewerNotification.isContentRefresh(), viewerNotification.isLabelUpdate()); 96 } 97 98 101 public Object getElement() 102 { 103 return element; 104 } 105 106 109 public boolean isContentRefresh() 110 { 111 return contentRefresh; 112 } 113 114 117 public boolean isLabelUpdate() 118 { 119 return labelUpdate; 120 } 121 } 122 | Popular Tags |