org.eclipse.wst.jsdt.chromium.debug.ui

## Class DialogUtils.Updater

- java.lang.Object
- - org.eclipse.wst.jsdt.chromium.debug.ui.DialogUtils.Updater

Enclosing class:
  DialogUtils

    public static class DialogUtils.Updater
    extends java.lang.Object

Helps to conduct update for vertices in a value graph. Technically Updater does not see a real graph, because it doesn't support vertices that are simultaneously source and consumer. Programmer helps manage other edges manually by calling `reportChanged(org.eclipse.wst.jsdt.chromium.debug.ui.DialogUtils.ValueSource<?>)` method.

Updater supports conditional updating. At some place in graph there may be switcher that introduces several scopes. The switcher has only one active scope at a time, that is controlled by an expression provided. The scope may contain parts of the graph and only the active scope has its vertices updated, update in other scopes is deferred. Vertices from the scope are only available via vertex called merger from outside of this scope. Scopes may be nested. Updater always has a root scope.

### Constructor Summary

Constructors
Constructor and Description
`Updater()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addConsumer(DialogUtils.Scope scope, DialogUtils.ValueConsumer consumer)` Registers a consumer within a particular scope.
`void` `addConsumer(DialogUtils.ValueConsumer value, DialogUtils.ValueSource<?>... dependencies)`
`void` `addConsumer(DialogUtils.ValueConsumer value, java.util.List<? extends DialogUtils.ValueSource<?>> dependencies)` Registers a consumer vertex with all its dependencies.
`void` `addDependency(DialogUtils.ValueConsumer consumer, DialogUtils.ValueSource<?> source)` Adds a dependency of consumer on source.
`void` `addDependency(DialogUtils.ValueConsumer consumer, java.util.List<? extends DialogUtils.ValueSource<?>> sourceList)` Adds a dependency of consumer on several sources.
`void` `addSource(DialogUtils.Scope scope, DialogUtils.ValueSource<?> source)` Registers a source within a particular scope.
`void` `reportChanged(DialogUtils.ValueSource<?> source)` Reports about sources that have been changed and plans future update of consumers.
`DialogUtils.Scope` `rootScope()` Returns a root scope that updater always has.
`void` `stopAsync()` Stops asynchronous updates -- an activity which is hard to stop directly.
`void` `update()` Performs update of all vertices that need it.
`void` `updateAll()` Updates all consumer vertices in graph.
`void` `updateAsync()` Request deferred update.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### Updater

    public Updater()

### Method Detail

#### addConsumer

    public void addConsumer(DialogUtils.ValueConsumer value,
                            DialogUtils.ValueSource<?>... dependencies)

#### addConsumer

    public void addConsumer(DialogUtils.ValueConsumer value,
                            java.util.List<? extends DialogUtils.ValueSource<?>> dependencies)

Registers a consumer vertex with all its dependencies. The root scope is assumed.

#### addConsumer

    public void addConsumer(DialogUtils.Scope scope,
                            DialogUtils.ValueConsumer consumer)

Registers a consumer within a particular scope.

#### addSource

    public void addSource(DialogUtils.Scope scope,
                          DialogUtils.ValueSource<?> source)

Registers a source within a particular scope.

#### addDependency

    public void addDependency(DialogUtils.ValueConsumer consumer,
                              DialogUtils.ValueSource<?> source)

Adds a dependency of consumer on source. Source may be from the same scope or from the outer scope.

#### addDependency

    public void addDependency(DialogUtils.ValueConsumer consumer,
                              java.util.List<? extends DialogUtils.ValueSource<?>> sourceList)

Adds a dependency of consumer on several sources. See `#addDependency(ValueConsumer, ValueSource)`.

#### reportChanged

    public void reportChanged(DialogUtils.ValueSource<?> source)

Reports about sources that have been changed and plans future update of consumers. This method may be called at any time.

#### update

    public void update()

Performs update of all vertices that need it. If some sources are reported changed during the run of this method, their consumers are also updated.

#### updateAll

    public void updateAll()

Updates all consumer vertices in graph.

#### rootScope

    public DialogUtils.Scope rootScope()

Returns a root scope that updater always has.

#### updateAsync

    public void updateAsync()

Request deferred update. This method may be called from any thread.

#### stopAsync

    public void stopAsync()

Stops asynchronous updates -- an activity which is hard to stop directly.