當前位置: 首頁>>代碼示例>>Java>>正文


Java Property.getValue方法代碼示例

本文整理匯總了Java中javafx.beans.property.Property.getValue方法的典型用法代碼示例。如果您正苦於以下問題:Java Property.getValue方法的具體用法?Java Property.getValue怎麽用?Java Property.getValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.beans.property.Property的用法示例。


在下文中一共展示了Property.getValue方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: bindBidirectional

import javafx.beans.property.Property; //導入方法依賴的package包/類
/**
 * Binds a {@link Property} by traversing the bean's field tree
 * 
 * @param fieldPath
 *            the <b><code>.</code></b> separated field paths relative to
 *            the {@link #getBean()} that will be traversed
 * @param property
 *            the {@link Property} to bind to the field class type of the
 *            property
 * @param propertyType
 *            the class type of the {@link Property} value
 */
@SuppressWarnings("unchecked")
public <T> void bindBidirectional(final String fieldPath,
		final Property<T> property, final Class<T> propertyType) {
	Class<T> clazz = propertyType != null ? propertyType
			: propertyValueClass(property);
	if (clazz == null && property.getValue() != null) {
		clazz = (Class<T>) property.getValue().getClass();
	}
	if (clazz == null || clazz == Object.class) {
		throw new UnsupportedOperationException(String.format(
				"Unable to determine property value class for %1$s "
						+ "and declared type %2$s", property, propertyType));
	}
	getRoot().performOperation(fieldPath, property, clazz,
			FieldBeanOperation.BIND);
}
 
開發者ID:PacktPublishing,項目名稱:Java-9-Programming-Blueprints,代碼行數:29,代碼來源:BeanPathAdapter.java

示例2: save

import javafx.beans.property.Property; //導入方法依賴的package包/類
/**
 * Saves a property to a preferences object.
 *
 * @param property    the property to save
 * @param preferences the preferences object to save to
 * @param serializer  a function to use to convert the property's value to a String that can be stored in
 * @param <T>         the type of the property
 *
 * @throws IllegalArgumentException if the value of the property is null
 */
public static <T> void save(Property<? extends T> property,
                            Preferences preferences,
                            Function<? super T, String> serializer) {
  T value = property.getValue();

  if (value == null) {
    throw new IllegalArgumentException("The property must have a value");
  }

  preferences.put(property.getName(), serializer.apply(value));
}
 
開發者ID:wpilibsuite,項目名稱:shuffleboard,代碼行數:22,代碼來源:PreferencesUtils.java

示例3: FlushableProperty

import javafx.beans.property.Property; //導入方法依賴的package包/類
/**
 * Create a new FlushableProperty.
 *
 * @param property The property to flush to
 */
public FlushableProperty(Property<T> property) {
  super(property.getBean(), property.getName(), property.getValue());
  this.property = property;
}
 
開發者ID:wpilibsuite,項目名稱:shuffleboard,代碼行數:10,代碼來源:FlushableProperty.java

示例4: SimpleStyleableObjectPropertyWrapper

import javafx.beans.property.Property; //導入方法依賴的package包/類
/**
 * Creates a new styleable property that wraps another.
 *
 * @param cssMetaData the CSS metadata describing this styleable property
 * @param property    the property to wrap
 */
public SimpleStyleableObjectPropertyWrapper(CssMetaData<? extends Styleable, T> cssMetaData, Property<T> property) {
  super(cssMetaData, property.getBean(), property.getName(), property.getValue());
  addListener((__, prev, cur) -> property.setValue(cur));
}
 
開發者ID:wpilibsuite,項目名稱:shuffleboard,代碼行數:11,代碼來源:SimpleStyleableObjectPropertyWrapper.java


注:本文中的javafx.beans.property.Property.getValue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。