Java 类javafx.beans.property.SetProperty 实例源码

项目:SynchronizeFX    文件:PropertyVisitor.java   
/**
 * 
 * @param object
 *            The object which fields should be visited.
 * @return {@code true} when the object was a observable object, {@code false} when it was a simple object.
 * @throws SecurityException
 *             If a {@link SecurityManager} is active and denies access to fields via reflection.
 * @throws IllegalAccessException
 *             If access modifiers like {@code private} are enforced even when the model is accessed via reflection.
 */
private boolean visitFields(final Object object) throws IllegalAccessException {
    boolean isObservableObject = false;
    for (final Field field : getInheritedFields(object.getClass())) {
        field.setAccessible(true);
        currentField = field;
        final Class<?> fieldClass = field.getType();

        if (!isObservableObject && classImplementsOrExtends(fieldClass, Property.class)) {
            startVisiting(object);
            isObservableObject = true;
        }

        if (classImplementsOrExtends(fieldClass, ListProperty.class)) {
            handle((ListProperty<?>) field.get(object));
        } else if (classImplementsOrExtends(fieldClass, SetProperty.class)) {
            handle((SetProperty<?>) field.get(object));
        } else if (classImplementsOrExtends(fieldClass, MapProperty.class)) {
            handle((MapProperty<?, ?>) field.get(object));
        } else if (classImplementsOrExtends(fieldClass, Property.class)) {
            handle((Property<?>) field.get(object));
        }
    }
    return isObservableObject;
}
项目:SynchronizeFX    文件:PropertyVisitor.java   
private void handle(final SetProperty<?> property) throws IllegalAccessException {
    if (visitCollectionProperty(property)) {
        for (Object child : property) {
            visit(child);
        }
    }
}
项目:SynchronizeFX    文件:PropertyVisitor.java   
Parent(final Property<?> parentProperty, final ListProperty<?> parentList, final SetProperty<?> parentSet,
        final MapProperty<?, ?> parentMap) {
    this.parentList = parentList;
    this.parentSet = parentSet;
    this.parentMap = parentMap;
    this.parentProperty = parentProperty;
}
项目:fx-gson    文件:SetPropertyTypeAdapter.java   
@NotNull
@Override
protected SetProperty<T> createProperty(ObservableSet<T> deserializedValue) {
    return new SimpleSetProperty<>(deserializedValue);
}
项目:LoliXL    文件:SimpleGameConfiguration.java   
public SetProperty<DefaultArgumentOption> defaultArgumentOptionsProperty() {
    return defaultArgumentOptionsProperty;
}
项目:LoliXL    文件:SimpleGameConfiguration.java   
public SetProperty<String> customizedClasspathProperty() {
    return customizedClasspathProperty;
}
项目:PeerWasp    文件:PathItem.java   
public void bindPermissionsTo(SetProperty<UserPermission> other){
    Set<UserPermission> oldPermissions = new HashSet<UserPermission>(getPermissions());
    getPermissionsSetProperty().bindContent(other);
    getPermissionsSetProperty().addAll(oldPermissions);
}
项目:PeerWasp    文件:PathItem.java   
public SetProperty<UserPermission> getPermissionsSetProperty(){
    return permissions;
}
项目:SynchronizeFX    文件:PropertyVisitor.java   
/**
 * Visit a field of type {@link SetProperty}.
 * 
 * @param fieldValue
 *            The value that is bound to the field.
 * @return {@code true} if the childs of this property should be visited, {@code false} if not.
 */
protected abstract boolean visitCollectionProperty(SetProperty<?> fieldValue);
项目:SynchronizeFX    文件:PropertyVisitor.java   
/**
 * @return The parent {@link SetProperty} if the parent of the current object is a {@link SetProperty}. If not or if
 *         this is the root element and therefore their is no parent {@code null} is returned.
 */
public SetProperty<?> getParentSet() {
    return parent.peek().parentSet;
}