Java 类javafx.beans.property.adapter.JavaBeanObjectProperty 实例源码

项目:photo-flow    文件:PhotoFlowController.java   
/**
 * @param bean
 * @param propertyName
 * @return {@link JavaBeanObjectProperty}
 */
protected static JavaBeanObjectProperty<Object> objectProperty(Object bean, String propertyName) {
    Object key = key(bean, propertyName);
    if (OBJECT_PROPERTIES.containsKey(key)) {
        return OBJECT_PROPERTIES.get(key);
    }
    try {
        @SuppressWarnings("unchecked")
        JavaBeanObjectProperty<Object> property = JavaBeanObjectPropertyBuilder.create().bean(bean).name(propertyName).build();
        OBJECT_PROPERTIES.put(key, property);
        return property;
    } catch (NoSuchMethodException e) {
        throw new IllegalStateException(e);
    }
}
项目:subshare    文件:PassphrasePane.java   
@SuppressWarnings("unchecked")
private JavaBeanObjectProperty<char[]> createPassphraseProperty() {
    try {
        return JavaBeanObjectPropertyBuilder.create()
                .bean(createPgpKeyParam)
                .name(CreatePgpKeyParam.PropertyEnum.passphrase.name())
                .build();
    } catch (NoSuchMethodException e) {
        throw new RuntimeException(e);
    }
}
项目:subshare    文件:AdvancedPane.java   
@SuppressWarnings("unchecked")
private JavaBeanObjectProperty<CreatePgpKeyParam.Algorithm> createAlgorithmProperty() {
    try {
        return JavaBeanObjectPropertyBuilder.create()
                .bean(createPgpKeyParam)
                .name(CreatePgpKeyParam.PropertyEnum.algorithm.name())
                .build();
    } catch (NoSuchMethodException e) {
        throw new RuntimeException(e);
    }
}