本文整理匯總了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());
}