T
- the type of value being observedpublic abstract class DuplexingObservableValue<T> extends AbstractObservableValue<T>
Constructor and Description |
---|
DuplexingObservableValue(IObservableList<T> target) |
DuplexingObservableValue(IObservableList<T> target,
Object valueType) |
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(IChangeListener listener)
Adds the given change listener to the list of change listeners.
|
protected void |
addListener(Object listenerType,
IObservablesListener listener) |
void |
addValueChangeListener(IValueChangeListener<? super T> listener) |
protected Object |
clone() |
protected abstract T |
coalesceElements(Collection<T> elements) |
void |
dispose()
Disposes of this observable object, removing all listeners registered
with this object, and all listeners this object might have registered on
other objects.
|
protected T |
doGetValue() |
protected void |
doSetValue(T value)
Template method for setting the value of the observable.
|
protected void |
fireEvent(ObservableEvent event) |
protected void |
firstListenerAdded() |
Realm |
getRealm() |
Object |
getValueType()
The value type of this observable value, or
null if this
observable value is untyped. |
protected boolean |
hasListeners() |
boolean |
isStale()
Returns whether the state of this observable is stale and is expected to
change soon.
|
protected void |
lastListenerRemoved() |
protected void |
makeDirty() |
protected void |
removeListener(Object listenerType,
IObservablesListener listener) |
static <T> DuplexingObservableValue<T> |
withDefaults(IObservableList<T> target,
T emptyValue,
T multiValue)
Returns a DuplexingObservableValue implementation with predefined values
to use if the list is empty or contains multiple different values.
|
fireChange, fireValueChange, getValue, removeValueChangeListener, setValue
addDisposeListener, addStaleListener, checkRealm, fireStale, isDisposed, removeChangeListener, removeDisposeListener, removeStaleListener
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addDisposeListener, addStaleListener, getRealm, isDisposed, removeChangeListener, removeDisposeListener, removeStaleListener
public DuplexingObservableValue(IObservableList<T> target)
target
- public DuplexingObservableValue(IObservableList<T> target, Object valueType)
target
- valueType
- public static <T> DuplexingObservableValue<T> withDefaults(IObservableList<T> target, T emptyValue, T multiValue)
T
- target
- the observable listemptyValue
- the value to use when the target list is emptymultiValue
- the value to use when the target list contains multiple values
that are not equivalent to each other.protected void firstListenerAdded()
protected void lastListenerRemoved()
protected final void makeDirty()
public boolean isStale()
IObservable
isStale
in interface IObservable
isStale
in class AbstractObservableValue<T>
protected T doGetValue()
doGetValue
in class AbstractObservableValue<T>
protected abstract T coalesceElements(Collection<T> elements)
protected void doSetValue(T value)
AbstractObservableValue
UnsupportedOperationException
.doSetValue
in class AbstractObservableValue<T>
public Object getValueType()
IObservableValue
null
if this
observable value is untyped.null
public void addChangeListener(IChangeListener listener)
IObservable
addChangeListener
in interface IObservable
addChangeListener
in class AbstractObservable
public void addValueChangeListener(IValueChangeListener<? super T> listener)
addValueChangeListener
in interface IObservableValue<T>
addValueChangeListener
in class AbstractObservableValue<T>
public void dispose()
IObservable
dispose
in interface IObservable
dispose
in class AbstractObservable
protected void addListener(Object listenerType, IObservablesListener listener)
listenerType
- listener
- protected void removeListener(Object listenerType, IObservablesListener listener)
listenerType
- listener
- protected boolean hasListeners()
protected void fireEvent(ObservableEvent event)
public Realm getRealm()
protected Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
Copyright (c) 2000, 2016 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.