Module is.codion.swing.common.ui
Class AbstractComponentValue<C extends JComponent,T>
java.lang.Object
is.codion.common.value.AbstractValue<T>
is.codion.swing.common.ui.component.value.AbstractComponentValue<C,T>
- Type Parameters:
C- the component typeT- the value type
- All Implemented Interfaces:
Observable<T>,Observer<T>,Value<T>,ComponentValue<C,T>
- Direct Known Subclasses:
AbstractTextComponentValue
public abstract class AbstractComponentValue<C extends JComponent,T>
extends AbstractValue<T>
implements ComponentValue<C,T>
An abstract base implementation of
ComponentValue.-
Nested Class Summary
Nested classes/interfaces inherited from interface is.codion.common.value.Value
Value.Builder<T,B extends Value.Builder<T, B>>, Value.BuilderFactory, Value.Notify, Value.Validator<T> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractComponentValue(C component) Instantiates a new nullableAbstractComponentValueprotectedAbstractComponentValue(C component, @Nullable T nullValue) Instantiates a newAbstractComponentValue -
Method Summary
Modifier and TypeMethodDescriptionfinal CReturns the value from the underlying componentgetValue()Returns the actual internal value.protected abstract voidsetComponentValue(@Nullable T value) Sets the given value in the underlying component.protected final voidSets the actual internal value.Methods inherited from class is.codion.common.value.AbstractValue
addValidator, clear, createObservable, get, isNullable, link, link, map, notifyObserver, observable, observer, removeValidator, set, unlink, unlink, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface is.codion.common.observer.Observable
addConsumer, addListener, addWeakConsumer, addWeakListener, get, getOrThrow, getOrThrow, is, isNot, isNull, isNullable, observer, optional, removeConsumer, removeListener, removeWeakConsumer, removeWeakListenerMethods inherited from interface is.codion.common.value.Value
addValidator, clear, link, link, map, observable, removeValidator, set, unlink, unlink, validate
-
Constructor Details
-
AbstractComponentValue
Instantiates a new nullableAbstractComponentValue- Parameters:
component- the component- Throws:
NullPointerException- in case component is null
-
AbstractComponentValue
Instantiates a newAbstractComponentValue- Parameters:
component- the componentnullValue- the value to use instead of null- Throws:
NullPointerException- in case component is null
-
-
Method Details
-
component
- Specified by:
componentin interfaceComponentValue<C extends JComponent,T> - Returns:
- the input component representing the value
-
getValue
Description copied from class:AbstractValueReturns the actual internal value.- Specified by:
getValuein classAbstractValue<T>- Returns:
- the value
-
setValue
Description copied from class:AbstractValueSets the actual internal value.- Specified by:
setValuein classAbstractValue<T>- Parameters:
value- the value
-
getComponentValue
Returns the value from the underlying component- Returns:
- the value from the underlying component
- See Also:
-
setComponentValue
Sets the given value in the underlying component. Note that this method is called on the Event Dispatch Thread.- Parameters:
value- the value to display in the underlying component- See Also:
-