public abstract class StringPropertyBase extends StringProperty
StringPropertyBase
is the base class for a property
wrapping a String
value.
It provides all the functionality required for a property except for the
ReadOnlyProperty.getBean()
and ReadOnlyProperty.getName()
methods, which must be implemented
by extending classes.StringProperty
Modifier and Type | Class and Description |
---|---|
private static class |
StringPropertyBase.Listener |
Modifier and Type | Field and Description |
---|---|
private <any> |
helper |
private InvalidationListener |
listener |
private <any> |
observable |
private boolean |
valid |
private java.lang.String |
value |
Constructor and Description |
---|
StringPropertyBase()
The constructor of the
StringPropertyBase . |
StringPropertyBase(java.lang.String initialValue)
The constructor of the
StringPropertyBase . |
Modifier and Type | Method and Description |
---|---|
void |
addListener(<any> listener) |
void |
addListener(InvalidationListener listener) |
void |
bind(<any> newObservable)
Create a unidirection binding for this
Property . |
protected void |
fireValueChangedEvent()
Sends notifications to all attached
InvalidationListeners and
ChangeListeners . |
java.lang.String |
get() |
protected void |
invalidated()
The method
invalidated() can be overridden to receive
invalidation notifications. |
boolean |
isBound()
Can be used to check, if a
Property is bound. |
private void |
markInvalid() |
void |
removeListener(<any> listener) |
void |
removeListener(InvalidationListener listener) |
void |
set(java.lang.String newValue) |
java.lang.String |
toString()
Returns a string representation of this
StringPropertyBase object. |
void |
unbind()
Remove the unidirectional binding for this
Property . |
bindBidirectional, bindBidirectional, bindBidirectional, setValue, unbindBidirectional, unbindBidirectional
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBean, getName
private java.lang.String value
private <any> observable
private InvalidationListener listener
private boolean valid
private <any> helper
public StringPropertyBase()
StringPropertyBase
.public StringPropertyBase(java.lang.String initialValue)
StringPropertyBase
.initialValue
- the initial value of the wrapped String
public void addListener(InvalidationListener listener)
public void removeListener(InvalidationListener listener)
public void addListener(<any> listener)
public void removeListener(<any> listener)
protected void fireValueChangedEvent()
InvalidationListeners
and
ChangeListeners
.
This method is called when the value is changed, either manually by
calling set(java.lang.String)
or in case of a bound property, if the
binding becomes invalid.private void markInvalid()
protected void invalidated()
invalidated()
can be overridden to receive
invalidation notifications. This is the preferred option in
Objects
defining the property, because it requires less memory.
The default implementation is empty.public java.lang.String get()
public void set(java.lang.String newValue)
public boolean isBound()
Property
is bound.true
if the Property
is bound, false
otherwise#bind(javafx.beans.value.ObservableValue)
public void bind(<any> newObservable)
Property
.
Note that JavaFX has all the bind calls implemented through weak listeners. This means the bound property can be garbage collected and stopped from being updated.
newObservable
- The observable this Property
should be bound to.public void unbind()
Property
.
If the Property
is not bound, calling this method has no effect.#bind(javafx.beans.value.ObservableValue)
public java.lang.String toString()
StringPropertyBase
object.toString
in class StringProperty
StringPropertyBase
object.