org.eclipse.emf.edit.provider
Class ViewerNotification

java.lang.Object
  extended by org.eclipse.emf.common.notify.NotificationWrapper
      extended by org.eclipse.emf.edit.provider.ViewerNotification
All Implemented Interfaces:
Notification, IViewerNotification

public class ViewerNotification
extends NotificationWrapper
implements IViewerNotification

A simple implementation of IViewerNotification that decorates an ordinary Notification.


Field Summary
protected  boolean contentRefresh
          Whether the content under the element should be structurally refreshed.
protected  java.lang.Object element
          The element to update or from which to refresh.
protected  boolean labelUpdate
          Whether the label and icon for the element should be updated.
 
Fields inherited from class org.eclipse.emf.common.notify.NotificationWrapper
notification, notifier
 
Fields inherited from interface org.eclipse.emf.common.notify.Notification
ADD, ADD_MANY, CREATE, EVENT_TYPE_COUNT, MOVE, NO_FEATURE_ID, NO_INDEX, REMOVE, REMOVE_MANY, REMOVING_ADAPTER, RESOLVE, SET, UNSET
 
Constructor Summary
ViewerNotification(IViewerNotification viewerNotification, java.lang.Object element)
          Wraps an existing viewer notification to specify a different element.
ViewerNotification(Notification decoratedNotification)
          Creates a notification to fully refresh a viewer.
ViewerNotification(Notification decoratedNotification, java.lang.Object element)
          Creates a notification to refresh the content under and update the label for the given element.
ViewerNotification(Notification decoratedNotification, java.lang.Object element, boolean contentRefresh, boolean labelUpdate)
          Creates a notification to optionally refresh the content under and update the label for the given element.
 
Method Summary
 java.lang.Object getElement()
          Returns the element to update or from which to refresh.
 boolean isContentRefresh()
          Returns whether the content under the element should be structurally refreshed.
 boolean isLabelUpdate()
          Returns whether the label and icon for the element should be updated.
 java.lang.String toString()
           
static Notification wrapNotification(Notification notification, java.lang.Object element)
          Wraps the given notification to make the given element be operated on by the viewer that receives it.
 
Methods inherited from class org.eclipse.emf.common.notify.NotificationWrapper
getEventType, getFeature, getFeatureID, getNewBooleanValue, getNewByteValue, getNewCharValue, getNewDoubleValue, getNewFloatValue, getNewIntValue, getNewLongValue, getNewShortValue, getNewStringValue, getNewValue, getNotifier, getOldBooleanValue, getOldByteValue, getOldCharValue, getOldDoubleValue, getOldFloatValue, getOldIntValue, getOldLongValue, getOldShortValue, getOldStringValue, getOldValue, getPosition, isReset, isTouch, merge, wasSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.emf.common.notify.Notification
getEventType, getFeature, getFeatureID, getNewBooleanValue, getNewByteValue, getNewCharValue, getNewDoubleValue, getNewFloatValue, getNewIntValue, getNewLongValue, getNewShortValue, getNewStringValue, getNewValue, getNotifier, getOldBooleanValue, getOldByteValue, getOldCharValue, getOldDoubleValue, getOldFloatValue, getOldIntValue, getOldLongValue, getOldShortValue, getOldStringValue, getOldValue, getPosition, isReset, isTouch, merge, wasSet
 

Field Detail

element

protected java.lang.Object element
The element to update or from which to refresh. The whole viewer is indicated by the null value.

See Also:
getElement()

contentRefresh

protected boolean contentRefresh
Whether the content under the element should be structurally refreshed.

See Also:
isContentRefresh()

labelUpdate

protected boolean labelUpdate
Whether the label and icon for the element should be updated.

See Also:
isLabelUpdate()
Constructor Detail

ViewerNotification

public ViewerNotification(Notification decoratedNotification)
Creates a notification to fully refresh a viewer.


ViewerNotification

public ViewerNotification(Notification decoratedNotification,
                          java.lang.Object element)
Creates a notification to refresh the content under and update the label for the given element.


ViewerNotification

public ViewerNotification(Notification decoratedNotification,
                          java.lang.Object element,
                          boolean contentRefresh,
                          boolean labelUpdate)
Creates a notification to optionally refresh the content under and update the label for the given element.


ViewerNotification

public ViewerNotification(IViewerNotification viewerNotification,
                          java.lang.Object element)
Wraps an existing viewer notification to specify a different element.

Method Detail

wrapNotification

public static Notification wrapNotification(Notification notification,
                                            java.lang.Object element)
Wraps the given notification to make the given element be operated on by the viewer that receives it. If the notification is an IViewerNotification, it is wrapped in a ViewerNotification, with that element. Otherwise, it is wrapped in a NotificationWrapper that returns the element as its notifier.


getElement

public java.lang.Object getElement()
Returns the element to update or from which to refresh.

Specified by:
getElement in interface IViewerNotification

isContentRefresh

public boolean isContentRefresh()
Returns whether the content under the element should be structurally refreshed.

Specified by:
isContentRefresh in interface IViewerNotification

isLabelUpdate

public boolean isLabelUpdate()
Returns whether the label and icon for the element should be updated.

Specified by:
isLabelUpdate in interface IViewerNotification

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.