protected static class BeanPathAdapter.FieldBean<PT,BT>
extends java.lang.Object
implements java.io.Serializable
A POJO bean extension that allows binding based upon a <b><code>.</code>
</b> separated field path that will be traversed on a bean until the
final field name is found. Each bean may contain child BeanPathAdapter.FieldBean
s
when an operation is perfomed with a direct descendant field that is a
non-primitive type. Any primitive types are added as a
BeanPathAdapter.FieldProperty
reference to the BeanPathAdapter.FieldBean
.
Modifier | Constructor and Description |
---|---|
protected |
FieldBean(BeanPathAdapter.FieldBean<?,PT> parent,
BeanPathAdapter.FieldHandle<PT,BT> fieldHandle,
jfxtras.labs.scene.control.BeanPathAdapter.FieldPathValueProperty notifyProperty)
Creates a
BeanPathAdapter.FieldBean |
protected |
FieldBean(BeanPathAdapter.FieldBean<?,PT> parent,
BT bean,
java.lang.String fieldName,
jfxtras.labs.scene.control.BeanPathAdapter.FieldPathValueProperty notifyProperty)
Creates a
BeanPathAdapter.FieldBean with a generated BeanPathAdapter.FieldHandle that
targets the supplied bean and is projected on the parent
BeanPathAdapter.FieldBean . |
Modifier and Type | Method and Description |
---|---|
protected void |
addFieldBean(BeanPathAdapter.FieldBean<BT,?> fieldBean)
Adds a child
BeanPathAdapter.FieldBean if it doesn’t already exist. |
protected void |
addOrUpdateFieldProperty(BeanPathAdapter.FieldProperty<BT,?,?> fieldProperty)
Adds or updates a child
BeanPathAdapter.FieldProperty . |
protected BeanPathAdapter.FieldHandle<PT,BT> |
createFieldHandle(PT parentBean,
BT bean,
java.lang.String fieldName)
Generates a
BeanPathAdapter.FieldHandle that targets the supplied bean and is
projected on the parent BeanPathAdapter.FieldBean that has |
BT |
getBean() |
protected java.util.Map<java.lang.String,BeanPathAdapter.FieldBean<BT,?>> |
getFieldBeans() |
java.lang.String |
getFieldName() |
protected java.util.Map<java.lang.String,BeanPathAdapter.FieldProperty<BT,?,?>> |
getFieldProperties() |
BeanPathAdapter.FieldProperty<BT,?,?> |
getFieldProperty(java.lang.String proptertyName) |
protected java.util.Map<java.lang.String,BeanPathAdapter.FieldProperty<BT,?,?>> |
getFieldSelectionProperties() |
<FCT,SMT> BeanPathAdapter.FieldStringConverter<FCT> |
getFieldStringConverter(java.lang.Class<FCT> targetClass)
Gets/Creates (if not already created) a
BeanPathAdapter.FieldStringConverter . |
BeanPathAdapter.FieldBean<?,PT> |
getParent() |
protected <T> void |
performOperation(BeanPathAdapter.FieldProperty<BT,?,?> fp,
javafx.beans.Observable observable,
java.lang.Class<T> observableValueClass,
BeanPathAdapter.FieldBeanOperation operation)
|
<T> BeanPathAdapter.FieldProperty<?,?,?> |
performOperation(java.lang.String fieldPath,
javafx.collections.ObservableList<T> observableList,
java.lang.Class<T> listValueClass,
java.lang.String collectionItemPath,
java.lang.Class<?> collectionItemPathType,
javafx.scene.control.SelectionModel<T> selectionModel,
BeanPathAdapter.FieldProperty<?,?,?> itemMaster,
BeanPathAdapter.FieldBeanOperation operation) |
<K,V> BeanPathAdapter.FieldProperty<?,?,?> |
performOperation(java.lang.String fieldPath,
javafx.collections.ObservableMap<K,V> observableMap,
java.lang.Class<V> mapValueClass,
java.lang.String collectionItemPath,
java.lang.Class<?> collectionItemPathType,
javafx.scene.control.SelectionModel<V> selectionModel,
BeanPathAdapter.FieldProperty<?,?,?> itemMaster,
BeanPathAdapter.FieldBeanOperation operation) |
<T> BeanPathAdapter.FieldProperty<?,?,?> |
performOperation(java.lang.String fieldPath,
javafx.collections.ObservableSet<T> observableSet,
java.lang.Class<T> setValueClass,
java.lang.String collectionItemPath,
java.lang.Class<?> collectionItemPathType,
javafx.scene.control.SelectionModel<T> selectionModel,
BeanPathAdapter.FieldProperty<?,?,?> itemMaster,
BeanPathAdapter.FieldBeanOperation operation) |
<T> BeanPathAdapter.FieldProperty<?,?,?> |
performOperation(java.lang.String fieldPath,
javafx.beans.property.Property<T> property,
java.lang.Class<T> propertyValueClass,
BeanPathAdapter.FieldBeanOperation operation) |
protected <T> BeanPathAdapter.FieldProperty<?,?,?> |
performOperation(java.lang.String fullFieldPath,
java.lang.String fieldPath,
java.lang.Class<T> propertyValueClass,
java.lang.String collectionItemPath,
javafx.beans.Observable observable,
java.lang.Class<?> collectionItemType,
javafx.scene.control.SelectionModel<T> selectionModel,
BeanPathAdapter.FieldProperty<?,?,?> itemMaster,
BeanPathAdapter.FieldBeanOperation operation)
Performs a
BeanPathAdapter.FieldBeanOperation by generating a
BeanPathAdapter.FieldProperty based upon the supplied <b><code>.</code> </b>
separated path to the field by traversing the matching children of
the BeanPathAdapter.FieldBean until the corresponding BeanPathAdapter.FieldProperty
is found (target bean uses the POJO from getBean()
). |
void |
setBean(BT bean)
Sets the bean of the
BeanPathAdapter.FieldBean and it’s underlying
getFieldBeans() , getFieldProperties() , and
getFieldSelectionProperties() |
void |
setParentBean(PT bean)
Binds a parent bean to the
BeanPathAdapter.FieldBean and it’s underlying
getFieldBeans() , getFieldProperties() , and
getFieldSelectionProperties() |
protected FieldBean(BeanPathAdapter.FieldBean<?,PT> parent, BeanPathAdapter.FieldHandle<PT,BT> fieldHandle, jfxtras.labs.scene.control.BeanPathAdapter.FieldPathValueProperty notifyProperty)
Creates a BeanPathAdapter.FieldBean
parent
- the parent BeanPathAdapter.FieldBean
(should not be null)fieldHandle
- the BeanPathAdapter.FieldHandle
(should not be null)notifyProperty
- the FieldPathValueProperty
that will be set every
time the setBean(Object)
is changedprotected FieldBean(BeanPathAdapter.FieldBean<?,PT> parent, BT bean, java.lang.String fieldName, jfxtras.labs.scene.control.BeanPathAdapter.FieldPathValueProperty notifyProperty)
Creates a BeanPathAdapter.FieldBean
with a generated BeanPathAdapter.FieldHandle
that
targets the supplied bean and is projected on the parent
BeanPathAdapter.FieldBean
. It assumes that the supplied BeanPathAdapter.FieldBean
has
been set on the parent BeanPathAdapter.FieldBean
.
parent
- the parent BeanPathAdapter.FieldBean
(null when it’s the root)bean
- the bean that the BeanPathAdapter.FieldBean
is forfieldName
- the field name of the parent BeanPathAdapter.FieldBean
for which
the new BeanPathAdapter.FieldBean
is fornotifyProperty
- the FieldPathValueProperty
that will be set every
time the setBean(Object)
is changedcreateFieldHandle(Object, Object, String)
protected BeanPathAdapter.FieldHandle<PT,BT> createFieldHandle(PT parentBean, BT bean, java.lang.String fieldName)
Generates a BeanPathAdapter.FieldHandle
that targets the supplied bean and is
projected on the parent BeanPathAdapter.FieldBean
that has
parentBean
- the parent beanbean
- the child beanfieldName
- the field name of the child within the parentBeanPathAdapter.FieldHandle
public BT getBean()
BeanPathAdapter.FieldBean
representssetParentBean(Object)
protected void addFieldBean(BeanPathAdapter.FieldBean<BT,?> fieldBean)
Adds a child BeanPathAdapter.FieldBean
if it doesn’t already exist. NOTE: It
does <b>NOT</b> ensure the child bean has been set on the parent.
fieldBean
- the BeanPathAdapter.FieldBean
to addprotected void addOrUpdateFieldProperty(BeanPathAdapter.FieldProperty<BT,?,?> fieldProperty)
Adds or updates a child BeanPathAdapter.FieldProperty
. When the child already
exists it will BeanPathAdapter.FieldProperty.setTarget(Object)
using the bean
of the BeanPathAdapter.FieldProperty
.
fieldProperty
- the BeanPathAdapter.FieldProperty
to add or updatepublic void setBean(BT bean)
Sets the bean of the BeanPathAdapter.FieldBean
and it’s underlying
getFieldBeans()
, getFieldProperties()
, and
getFieldSelectionProperties()
bean
- the bean to setsetParentBean(Object)
public void setParentBean(PT bean)
Binds a parent bean to the BeanPathAdapter.FieldBean
and it’s underlying
getFieldBeans()
, getFieldProperties()
, and
getFieldSelectionProperties()
bean
- the parent bean to bind tosetBean(Object)
public <T> BeanPathAdapter.FieldProperty<?,?,?> performOperation(java.lang.String fieldPath, javafx.beans.property.Property<T> property, java.lang.Class<T> propertyValueClass, BeanPathAdapter.FieldBeanOperation operation)
BeanPathAdapter.FieldBean#performOperation(String, String,
Class, String, Observable, Class, SelectionModel, FieldProperty,
FieldBeanOperation)
public <T> BeanPathAdapter.FieldProperty<?,?,?> performOperation(java.lang.String fieldPath, javafx.collections.ObservableList<T> observableList, java.lang.Class<T> listValueClass, java.lang.String collectionItemPath, java.lang.Class<?> collectionItemPathType, javafx.scene.control.SelectionModel<T> selectionModel, BeanPathAdapter.FieldProperty<?,?,?> itemMaster, BeanPathAdapter.FieldBeanOperation operation)
BeanPathAdapter.FieldBean#performOperation(String, String,
Class, String, Observable, Class, SelectionModel, FieldProperty,
FieldBeanOperation)
public <T> BeanPathAdapter.FieldProperty<?,?,?> performOperation(java.lang.String fieldPath, javafx.collections.ObservableSet<T> observableSet, java.lang.Class<T> setValueClass, java.lang.String collectionItemPath, java.lang.Class<?> collectionItemPathType, javafx.scene.control.SelectionModel<T> selectionModel, BeanPathAdapter.FieldProperty<?,?,?> itemMaster, BeanPathAdapter.FieldBeanOperation operation)
BeanPathAdapter.FieldBean#performOperation(String, String,
Class, String, Observable, Class, SelectionModel, FieldProperty,
FieldBeanOperation)
public <K,V> BeanPathAdapter.FieldProperty<?,?,?> performOperation(java.lang.String fieldPath, javafx.collections.ObservableMap<K,V> observableMap, java.lang.Class<V> mapValueClass, java.lang.String collectionItemPath, java.lang.Class<?> collectionItemPathType, javafx.scene.control.SelectionModel<V> selectionModel, BeanPathAdapter.FieldProperty<?,?,?> itemMaster, BeanPathAdapter.FieldBeanOperation operation)
BeanPathAdapter.FieldBean#performOperation(String, String,
Class, String, Observable, Class, SelectionModel, FieldProperty,
FieldBeanOperation)
protected <T> BeanPathAdapter.FieldProperty<?,?,?> performOperation(java.lang.String fullFieldPath, java.lang.String fieldPath, java.lang.Class<T> propertyValueClass, java.lang.String collectionItemPath, javafx.beans.Observable observable, java.lang.Class<?> collectionItemType, javafx.scene.control.SelectionModel<T> selectionModel, BeanPathAdapter.FieldProperty<?,?,?> itemMaster, BeanPathAdapter.FieldBeanOperation operation)
Performs a BeanPathAdapter.FieldBeanOperation
by generating a
BeanPathAdapter.FieldProperty
based upon the supplied <b><code>.</code> </b>
separated path to the field by traversing the matching children of
the BeanPathAdapter.FieldBean
until the corresponding BeanPathAdapter.FieldProperty
is found (target bean uses the POJO from getBean()
). If the operation is bind and the BeanPathAdapter.FieldProperty
doesn’t
exist all relative BeanPathAdapter.FieldBean
s in the path will be
instantiated using a no-argument constructor until the
BeanPathAdapter.FieldProperty
is created and bound to the supplied
Property
. The process is reciprocated until all path
BeanPathAdapter.FieldBean
and BeanPathAdapter.FieldProperty
attributes of the field
path are extinguished.
fullFieldPath
- the full <code>.</code> separated field names (used in
recursion of method call to maintain the original path and
should not be used in initial method invocation)fieldPath
- the <code>.</code> separated field namespropertyValueClass
- the class of the Property
value type (only needed
when binding)collectionItemPath
- the the <code>.</code> separated field names of the
Observable
collection (only applicable when the
Observable
is a ObservableList
,
ObservableSet
, or ObservableMap
)observable
- the Property
, ObservableList
,
ObservableSet
, or ObservableMap
to perform
the BeanPathAdapter.FieldBeanOperation
oncollectionItemType
- the Observable
Class
of each item in the
Observable
collection (only applicable when the
Observable
is a ObservableList
,
ObservableSet
, or ObservableMap
)selectionModel
- the SelectionModel
used to set the values within
the Observable
<b>only applicable when the
Observable
is used for selection(s) and therefore
cannot be updated directly because it is read-only</b>itemMaster
- the BeanPathAdapter.FieldProperty
that contains the item(s) that
the SelectionModel
can select fromoperation
- the BeanPathAdapter.FieldBeanOperation
BeanPathAdapter.FieldProperty
the operation was performed on
(null when the operation was not performed on any
BeanPathAdapter.FieldProperty
Bindings.bindBidirectional(Property, Property)
,
Bindings.unbindBidirectional(Property, Property)
protected <T> void performOperation(BeanPathAdapter.FieldProperty<BT,?,?> fp, javafx.beans.Observable observable, java.lang.Class<T> observableValueClass, BeanPathAdapter.FieldBeanOperation operation)
Performs a BeanPathAdapter.FieldBeanOperation
on a BeanPathAdapter.FieldProperty
and
an Observable
fp
- the BeanPathAdapter.FieldProperty
observable
- the Property
, ObservableList
,
ObservableSet
, or ObservableMap
to perform
the BeanPathAdapter.FieldBeanOperation
onobservableValueClass
- the Class
of the Observable
valueoperation
- the BeanPathAdapter.FieldBeanOperation
public java.lang.String getFieldName()
BeanPathAdapter.FieldBean
represents in it’s
parent (null when the BeanPathAdapter.FieldBean
is root)public BeanPathAdapter.FieldBean<?,PT> getParent()
BeanPathAdapter.FieldBean
(null when the BeanPathAdapter.FieldBean
is root)protected java.util.Map<java.lang.String,BeanPathAdapter.FieldBean<BT,?>> getFieldBeans()
Map
of fields that belong to the
BeanPathAdapter.FieldBean
that are not a BeanPathAdapter.FieldProperty
, but
rather exist as a BeanPathAdapter.FieldBean
that may or may not
contain their own BeanPathAdapter.FieldProperty
instancesgetFieldProperties()
,
getFieldSelectionProperties()
protected java.util.Map<java.lang.String,BeanPathAdapter.FieldProperty<BT,?,?>> getFieldProperties()
Map
of fields that belong to the
BeanPathAdapter.FieldBean
that are not BeanPathAdapter.FieldBean
s, but rather
exist as a BeanPathAdapter.FieldProperty
and are not
getFieldSelectionProperties()
getFieldSelectionProperties()
,
getFieldBeans()
protected java.util.Map<java.lang.String,BeanPathAdapter.FieldProperty<BT,?,?>> getFieldSelectionProperties()
Map
of fields that belong to the
BeanPathAdapter.FieldBean
that are not BeanPathAdapter.FieldBean
s, but rather
exist as a BeanPathAdapter.FieldProperty
that are not
getFieldProperties()
getFieldProperties()
,
getFieldBeans()
public BeanPathAdapter.FieldProperty<BT,?,?> getFieldProperty(java.lang.String proptertyName)
BeanPathAdapter.FieldProperty
with the given name that belongs to
the BeanPathAdapter.FieldBean
(null when the name does not exist)getFieldProperties()
,
getFieldSelectionProperties()
public <FCT,SMT> BeanPathAdapter.FieldStringConverter<FCT> getFieldStringConverter(java.lang.Class<FCT> targetClass)
Gets/Creates (if not already created) a BeanPathAdapter.FieldStringConverter
.
targetClass
- the target class of the BeanPathAdapter.FieldStringConverter
BeanPathAdapter.FieldStringConverter