## org.eclipse.emf.edit.ui.provider
Class AdapterFactoryContentProvider.ViewerRefresh

    java.lang.Object
      org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider.ViewerRefresh

All Implemented Interfaces:
  java.lang.Runnable

Enclosing class:
  AdapterFactoryContentProvider

    public static class AdapterFactoryContentProvider.ViewerRefresh

extends java.lang.Object
implements java.lang.Runnable

A runnable class that efficiently updates a `Viewer` via standard APIs, based on queued `IViewerNotification`s from the model's item providers.

Constructor Summary
`AdapterFactoryContentProvider.ViewerRefresh(Viewer viewer)`
`AdapterFactoryContentProvider.ViewerRefresh(Viewer viewer, IViewerNotification notification)` Deprecated. in 2.2.0

Method Summary
`boolean` `addNotification(IViewerNotification notification)` Adds a viewer notification to the queue that will be processed by this `ViewerRefresh`.
`protected IViewerNotification` `merge(IViewerNotification n1, IViewerNotification n2)` Compares two notifications and, if duplicative, returns a single notification that does the work of both.
`protected void` `refresh(IViewerNotification notification)`
`void` `run()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AdapterFactoryContentProvider.ViewerRefresh

    public AdapterFactoryContentProvider.ViewerRefresh(Viewer viewer)

Since:
  2.2.0

### AdapterFactoryContentProvider.ViewerRefresh

    @Deprecated
    public AdapterFactoryContentProvider.ViewerRefresh(Viewer viewer,
                                                                  IViewerNotification notification)

  Deprecated. in 2.2.0

Method Detail

### addNotification

    public boolean addNotification(IViewerNotification notification)

  Adds a viewer notification to the queue that will be processed by this `ViewerRefresh`. Duplicative notifications will not be queued.

  Parameters:
    `notification` - the notification to add to the queue
  Returns:
    whether the queue has been made non-empty, which would indicate that the `ViewerRefresh` needs to be `scheduled` on the event queue
  Since:
    2.2.0

### merge

    protected IViewerNotification merge(IViewerNotification n1,
                                        IViewerNotification n2)

  Compares two notifications and, if duplicative, returns a single notification that does the work of both. Note: this gives priority to a content refresh on the whole viewer over a content refresh or label update on a specific element; however, it doesn't use parent-child relationships to determine if refreshes on non-equal elements are duplicative.

  Returns:
    a single notification that is equivalent to the two parameters, or null if they are non-duplicative
  Since:
    2.2.0

### run

    public void run()

  Specified by:
    `run` in interface `java.lang.Runnable`

### refresh

    protected void refresh(IViewerNotification notification)

  Since:
    2.2.0

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