Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (C) 2007 Sun Microsystems, Inc. All rights reserved. Use is
* subject to license terms.
*/
package org.jdesktop.beansbinding;
/**
* A factory class for creating instances of the concrete {@code Binding}
* implementations provided by this package.
*
* @author Shannon Hickey
*/
public class Bindings {
private Bindings() {}
/**
* Creates an instance of {@code AutoBinding} that binds a source object to a property of a target object.
* The {@code AutoBinding's} source property is set to an instance of {@code ObjectProperty} so that the
* source object is used directly, rather than some property of the source object.
*
* @param strategy the update strategy for the binding
* @param sourceObject the source object
* @param targetObject the target object
* @param targetProperty the target property
* @return an {@code AutoBinding} that binds the source object to the target property of the target object
* @throws IllegalArgumentException if the update strategy or target property is {@code null}
*/
public static AutoBinding createAutoBinding(AutoBinding.UpdateStrategy strategy, SS sourceObject, TS targetObject, Property targetProperty) {
return new AutoBinding(strategy, sourceObject, ObjectProperty.create(), targetObject, targetProperty, null);
}
/**
* Creates a named instance of {@code AutoBinding} that binds a source object to a property of a target object.
* The {@code AutoBinding's} source property is set to an instance of {@code ObjectProperty} so that the
* source object is used directly, rather than some property of the source object.
*
* @param strategy the update strategy for the binding
* @param sourceObject the source object
* @param targetObject the target object
* @param targetProperty the target property
* @param name a name for the binding
* @return an {@code AutoBinding} that binds the source object to the target property of the target object
* @throws IllegalArgumentException if the update strategy or target property is {@code null}
*/
public static AutoBinding createAutoBinding(AutoBinding.UpdateStrategy strategy, SS sourceObject, TS targetObject, Property targetProperty, String name) {
return new AutoBinding(strategy, sourceObject, ObjectProperty.create(), targetObject, targetProperty, name);
}
/**
* Creates an instance of {@code AutoBinding} that binds a property of a source object to a property of a target object.
*
* @param strategy the update strategy for the binding
* @param sourceObject the source object
* @param sourceProperty the source property
* @param targetObject the target object
* @param targetProperty the target property
* @return an {@code AutoBinding} that binds the source object to the target property of the target object
* @throws IllegalArgumentException if the update strategy, source property or target property is {@code null}
*/
public static AutoBinding createAutoBinding(AutoBinding.UpdateStrategy strategy, SS sourceObject, Property sourceProperty, TS targetObject, Property targetProperty) {
return new AutoBinding(strategy, sourceObject, sourceProperty, targetObject, targetProperty, null);
}
/**
* Creates a named instance of {@code AutoBinding} that binds a property of a source object to a property of a target object.
*
* @param strategy the update strategy for the binding
* @param sourceObject the source object
* @param sourceProperty the source property
* @param targetObject the target object
* @param targetProperty the target property
* @param name a name for the binding
* @return an {@code AutoBinding} that binds the source object to the target property of the target object
* @throws IllegalArgumentException if the update strategy, source property or target property is {@code null}
*/
public static AutoBinding createAutoBinding(AutoBinding.UpdateStrategy strategy, SS sourceObject, Property sourceProperty, TS targetObject, Property targetProperty, String name) {
return new AutoBinding(strategy, sourceObject, sourceProperty, targetObject, targetProperty, name);
}
}