public abstract class StringProperty extends ReadOnlyStringProperty implements Property<String>, WritableStringValue
Property wrapping a
String value.
The value of a StringProperty can be get and set with ObservableObjectValue.get(),
StringExpression.getValue(), WritableObjectValue.set(Object), and setValue(String).
A property can be bound and unbound unidirectional with
Property.bind(ObservableValue) and Property.unbind(). Bidirectional bindings
can be created and removed with bindBidirectional(Property) and
unbindBidirectional(Property).
The context of a StringProperty can be read with ReadOnlyProperty.getBean()
and ReadOnlyProperty.getName().ObservableStringValue,
WritableStringValue,
ReadOnlyStringProperty,
Property| Constructor and Description |
|---|
StringProperty() |
| Modifier and Type | Method and Description |
|---|---|
void |
bindBidirectional(Property<?> other,
Format format)
Create a bidirectional binding between this
StringProperty and another
arbitrary property. |
void |
bindBidirectional(Property<String> other)
Create a bidirectional binding between this
Property and another
one. |
<T> void |
bindBidirectional(Property<T> other,
StringConverter<T> converter)
Create a bidirectional binding between this
StringProperty and another
arbitrary property. |
void |
setValue(String v)
Set the wrapped value.
|
String |
toString()
Returns a string representation of this
StringProperty object. |
void |
unbindBidirectional(Object other)
Remove a bidirectional binding between this
Property and another
one. |
void |
unbindBidirectional(Property<String> other)
Remove a bidirectional binding between this
Property and another
one. |
concat, getValue, getValueSafe, greaterThan, greaterThan, greaterThanOrEqualTo, greaterThanOrEqualTo, isEmpty, isEqualTo, isEqualTo, isEqualToIgnoreCase, isEqualToIgnoreCase, isNotEmpty, isNotEqualTo, isNotEqualTo, isNotEqualToIgnoreCase, isNotEqualToIgnoreCase, isNotNull, isNull, length, lessThan, lessThan, lessThanOrEqualTo, lessThanOrEqualTo, stringExpressionclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetBean, getNameaddListener, getValue, removeListeneraddListener, removeListenerget, setgetValuegetpublic void setValue(String v)
setValue in interface WritableValue<String>v - The new valuepublic void bindBidirectional(Property<String> other)
Property and another
one.
Bidirectional bindings exists independently of unidirectional bindings. So it is possible to
add unidirectional binding to a property with bidirectional binding and vice-versa. However, this practice is
discouraged.
It is possible to have multiple bidirectional bindings of one Property.
JavaFX bidirectional binding implementation use weak listeners. This means bidirectional binding does not prevent properties from being garbage collected.
bindBidirectional in interface Property<String>other - the other Propertypublic void bindBidirectional(Property<?> other, Format format)
StringProperty and another
arbitrary property. Relies on an implementation of Format for conversion.other - the other Propertyformat - the Format used to convert between this StringProperty
and the other PropertyNullPointerException - if other or format is nullIllegalArgumentException - if other is thispublic <T> void bindBidirectional(Property<T> other, StringConverter<T> converter)
StringProperty and another
arbitrary property. Relies on an implementation of StringConverter for conversion.other - the other Propertyconverter - the StringConverter used to convert between this StringProperty
and the other PropertyNullPointerException - if other or converter is nullIllegalArgumentException - if other is thispublic void unbindBidirectional(Property<String> other)
Property and another
one.
If no bidirectional binding between the properties exists, calling this
method has no effect.
It is possible to unbind by a call on the second property. This code will work:
property1.bindBirectional(property2);
property2.unbindBidirectional(property1);
unbindBidirectional in interface Property<String>other - the other Propertypublic void unbindBidirectional(Object other)
Property and another
one.
If no bidirectional binding between the properties exists, calling this
method has no effect.other - the other PropertyNullPointerException - if other is nullIllegalArgumentException - if other is thispublic String toString()
StringProperty object.toString in class ReadOnlyStringPropertyStringProperty object.Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.