Class SelectObservableValue<T>
java.lang.Object
org.eclipse.core.databinding.observable.AbstractObservable
org.eclipse.core.databinding.observable.value.AbstractObservableValue<T>
org.eclipse.core.databinding.observable.value.SelectObservableValue<T>
- Type Parameters:
T
- the type of value being observed
- All Implemented Interfaces:
IObservable
,IObservableValue<T>
An observable value which behaves similarly to the <select> and
<option> HTML tags. A SelectObservableValue has a number of options
added to it via the
addOption(Object, IObservableValue)
method. The
value of the SelectObservableValue is the value of whichever option's
observable has a value of Boolean.TRUE, or null if none of the observable's
values are Boolean.TRUE.- Since:
- 1.2
- Restriction:
- This class is not intended to be subclassed by clients.
-
Constructor Summary
ConstructorDescriptionConstructs a SelectObservableValue on the default realm.SelectObservableValue
(Object valueType) Constructs a SelectObservableValue on the default realm, with the given value type.SelectObservableValue
(Realm realm) Constructs a SelectObservableValue on the specified realm.SelectObservableValue
(Realm realm, Object valueType) Constructs a SelectObservableValue on the given realm, with the given value type. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addListener
(Object listenerType, IObservablesListener listener) void
addOption
(T value, IObservableValue<Boolean> observable) Adds an option to this SelectObservableValue.protected Object
clone()
protected T
protected void
doSetValue
(Object value) Template method for setting the value of the observable.protected void
fireEvent
(ObservableEvent event) protected void
getRealm()
The value type of this observable value, ornull
if this observable value is untyped.protected boolean
protected void
protected void
removeListener
(Object listenerType, IObservablesListener listener) Methods inherited from class org.eclipse.core.databinding.observable.value.AbstractObservableValue
addValueChangeListener, fireChange, fireValueChange, getValue, isStale, removeValueChangeListener, setValue
Methods inherited from class org.eclipse.core.databinding.observable.AbstractObservable
addChangeListener, addDisposeListener, addStaleListener, checkRealm, dispose, fireStale, isDisposed, removeChangeListener, removeDisposeListener, removeStaleListener
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.core.databinding.observable.IObservable
addChangeListener, addDisposeListener, addStaleListener, dispose, getRealm, isDisposed, removeChangeListener, removeDisposeListener, removeStaleListener
-
Constructor Details
-
SelectObservableValue
public SelectObservableValue()Constructs a SelectObservableValue on the default realm. -
SelectObservableValue
Constructs a SelectObservableValue on the specified realm.- Parameters:
realm
- the realm
-
SelectObservableValue
Constructs a SelectObservableValue on the default realm, with the given value type.- Parameters:
valueType
- the value type
-
SelectObservableValue
Constructs a SelectObservableValue on the given realm, with the given value type.- Parameters:
realm
- the realmvalueType
- the value type
-
-
Method Details
-
firstListenerAdded
protected void firstListenerAdded() -
lastListenerRemoved
protected void lastListenerRemoved() -
getValueType
Description copied from interface:IObservableValue
The value type of this observable value, ornull
if this observable value is untyped.- Returns:
- the value type, or
null
-
addOption
Adds an option to this SelectObservableValue. If the observable contains Boolean.TRUE then the selection changes immediately to the given value.- Parameters:
value
- The value associated with the provided observableobservable
- an observable of value type Boolean.class or Boolean.TYPE
-
doGetValue
- Specified by:
doGetValue
in classAbstractObservableValue<T>
-
doSetValue
Description copied from class:AbstractObservableValue
Template method for setting the value of the observable. By default the method throws anUnsupportedOperationException
.- Overrides:
doSetValue
in classAbstractObservableValue<T>
- Parameters:
value
- the value to set
-
addListener
- Parameters:
listenerType
- arbitrary object to identify a type of the listenerlistener
- the listener to add; notnull
-
removeListener
- Parameters:
listenerType
- arbitrary object to identify a type of the listenerlistener
- the listener to remove; notnull
-
hasListeners
protected boolean hasListeners() -
fireEvent
-
getRealm
- Returns:
- Returns the realm.
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-