本文整理汇总了Java中javafx.beans.property.BooleanProperty.set方法的典型用法代码示例。如果您正苦于以下问题:Java BooleanProperty.set方法的具体用法?Java BooleanProperty.set怎么用?Java BooleanProperty.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.beans.property.BooleanProperty
的用法示例。
在下文中一共展示了BooleanProperty.set方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testClearColumnListenerSelection
import javafx.beans.property.BooleanProperty; //导入方法依赖的package包/类
@Test
public void testClearColumnListenerSelection() {
BooleanProperty wasCalled = new SimpleBooleanProperty(false);
Selection selection = new Selection("fgrfg", 4);
InvalidationListener listener = i -> wasCalled.set(true);
selection.columnProperty().addListener(listener);
selection.columnProperty().set(null);
assertTrue(wasCalled.get());
assertTrue(selection.columnProperty().isNull().get());
wasCalled.set(false);
selection.columnProperty().removeListener(listener);
selection.setColumn("Test");
assertFalse(wasCalled.get());
assertEquals("Test", selection.getColumn().get());
}
示例2: bind
import javafx.beans.property.BooleanProperty; //导入方法依赖的package包/类
public void bind(final BooleanProperty property, final String propertyName) {
String value = props.getProperty(propertyName);
if (value != null) {
property.set(Boolean.valueOf(value));
}
property.addListener(new InvalidationListener() {
@Override
public void invalidated(Observable o) {
props.setProperty(propertyName, property.getValue().toString());
}
});
}
示例3: setCalendarVisibility
import javafx.beans.property.BooleanProperty; //导入方法依赖的package包/类
public final void setCalendarVisibility(Calendar calendar, boolean visible) {
BooleanProperty prop = getCalendarVisibilityProperty(calendar);
prop.set(visible);
}
示例4: bind
import javafx.beans.property.BooleanProperty; //导入方法依赖的package包/类
private void bind(BooleanProperty booleanProperty, BooleanProperty booleanProperty2) {
booleanProperty.set(booleanProperty2.get());
}