|
|
|
|
org.eclipse.core.databinding
Class AggregateValidationStatus
java.lang.Object
org.eclipse.core.databinding.observable.AbstractObservable
org.eclipse.core.databinding.observable.value.AbstractObservableValue
org.eclipse.core.databinding.observable.value.ComputedValue
org.eclipse.core.databinding.AggregateValidationStatus
-
All Implemented Interfaces:
-
IObservable,
IObservableValue
-
public final class AggregateValidationStatus
- extends
ComputedValue
This class can be used to aggregate status values from a data binding context
into a single status value. Instances of this class can be used as an
observable value with a value type of
IStatus , or the static methods
can be called directly if an aggregated status result is only needed once.
-
Since:
- 1.0
Field Summary
|
static int
|
MAX_SEVERITY
Constant denoting an aggregation strategy that always returns the most
severe status from the given validation status providers. |
static int
|
MERGED
Constant denoting an aggregation strategy that merges multiple non-OK
status objects in a
MultiStatus . |
MERGED
public static final int MERGED
- Constant denoting an aggregation strategy that merges multiple non-OK
status objects in a
MultiStatus . Returns an OK status result if
all statuses from the given validation status providers are the an OK
status. Returns a single status if there is only one non-OK status.
-
See Also:
-
getStatusMerged(Collection) ,
Constant Field Values
MAX_SEVERITY
public static final int MAX_SEVERITY
- Constant denoting an aggregation strategy that always returns the most
severe status from the given validation status providers. If there is
more than one status at the same severity level, it picks the first one
it encounters.
-
See Also:
-
getStatusMaxSeverity(Collection) ,
Constant Field Values
AggregateValidationStatus
public AggregateValidationStatus(
DataBindingContext dbc,
int strategy)
- Creates a new aggregate validation status observable for the given data
binding context.
-
Parameters:
-
dbc - a data binding context -
strategy - a strategy constant, one of
MERGED or
MAX_SEVERITY . -
Since:
- 1.1
AggregateValidationStatus
public AggregateValidationStatus(
IObservableCollection validationStatusProviders,
int strategy)
-
Parameters:
-
validationStatusProviders - an observable collection containing elements of type
ValidationStatusProvider
-
strategy - a strategy constant, one of
MERGED or
MAX_SEVERITY . -
See Also:
-
DataBindingContext.getValidationStatusProviders()
AggregateValidationStatus
public AggregateValidationStatus(
Realm realm,
IObservableCollection validationStatusProviders,
int strategy)
-
Parameters:
-
realm - Realm -
validationStatusProviders - an observable collection containing elements of type
ValidationStatusProvider
-
strategy - a strategy constant, one of
MERGED or
MAX_SEVERITY . -
Since:
- 1.1
-
See Also:
-
DataBindingContext.getValidationStatusProviders()
calculate
protected
Object calculate()
-
Description copied from class:
ComputedValue
- Subclasses must override this method to provide the object's value. Any
dependencies used to calculate the value must be
IObservable , and
implementers must use one of the interface methods tagged TrackedGetter
for ComputedValue to recognize it as a dependency.
-
-
Specified by:
-
calculate
in class
ComputedValue
-
-
Returns:
- the object's value
getStatusMerged
public static
IStatus getStatusMerged(
Collection validationStatusProviders)
- Returns a status object that merges multiple non-OK status objects in a
MultiStatus . Returns an OK status result if all statuses from the
given validation status providers are the an OK status. Returns a single
status if there is only one non-OK status.
-
-
Parameters:
-
validationStatusProviders - a collection of validation status providers
-
Returns:
- a merged status
getStatusMaxSeverity
public static
IStatus getStatusMaxSeverity(
Collection validationStatusProviders)
- Returns a status that always returns the most severe status from the
given validation status providers. If there is more than one status at
the same severity level, it picks the first one it encounters.
-
-
Parameters:
-
validationStatusProviders - a collection of validation status providers
-
Returns:
- a single status reflecting the most severe status from the given
validation status providers
addListener
protected void addListener(
Object listenerType,
IObservablesListener listener)
-
-
Parameters:
-
listenerType - -
listener -
removeListener
protected void removeListener(
Object listenerType,
IObservablesListener listener)
-
-
Parameters:
-
listenerType - -
listener -
fireEvent
protected void fireEvent(
ObservableEvent event)
-
firstListenerAdded
protected void firstListenerAdded()
-
lastListenerRemoved
protected void lastListenerRemoved()
-
getRealm
public
Realm getRealm()
-
-
Returns:
- Returns the realm.
clone
protected
Object clone()
throws
CloneNotSupportedException
-
-
Overrides:
-
clone
in class
Object
-
-
Throws:
-
CloneNotSupportedException
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.
|
|
|