@Override public void unbind() { delegate.unbind(); }
private static void unconfigure(final MenuItem menuItem) { if (menuItem == null || !(menuItem.getOnAction() instanceof Action)) { return; } Action action = (Action) menuItem.getOnAction(); menuItem.styleProperty().unbind(); menuItem.textProperty().unbind(); menuItem.disableProperty().unbind(); menuItem.acceleratorProperty().unbind(); menuItem.graphicProperty().unbind(); action.getProperties().removeListener(new MenuItemPropertiesMapChangeListener<>(menuItem, action)); if (menuItem instanceof RadioMenuItem) { ((RadioMenuItem) menuItem).selectedProperty().unbindBidirectional(action.selectedProperty()); } else if (menuItem instanceof CheckMenuItem) { ((CheckMenuItem) menuItem).selectedProperty().unbindBidirectional(action.selectedProperty()); } menuItem.setOnAction(null); }
@Override protected void executeTask(Task<V> task) { cancelable.unbind(); if (task instanceof DataFxTask) { cancelable.bind(((DataFxTask<V>) task).cancelableProperty()); } Executor e = getExecutor(); if (e != null) { e.execute(task); } else { ObservableExecutor.getDefaultInstance().execute(task); } }
private static void unconfigure(final ButtonBase btn) { if (btn == null || !(btn.getOnAction() instanceof Action)) { return; } Action action = (Action) btn.getOnAction(); btn.styleProperty().unbind(); btn.textProperty().unbind(); btn.disableProperty().unbind(); btn.graphicProperty().unbind(); action.getProperties().removeListener(new ButtonPropertiesMapChangeListener<>(btn, action)); btn.tooltipProperty().unbind(); if (btn instanceof ToggleButton) { ((ToggleButton) btn).selectedProperty().unbindBidirectional(action.selectedProperty()); } btn.setOnAction(null); }
clippedNode.visibleProperty().unbind(); clippedNode.setVisible(true);
PseudoClass nearlyExpired = PseudoClass.getPseudoClass("nearly-expired"); table.setRowFactory(tv -> { TableRow<Bill> row = new TableRow<>() ; BooleanProperty nearlyDueProperty = new SimpleBooleanProperty(); nearlyDueProperty.addListener((obs, wasNearlyDue, isNearlyDue) -> row.pseudoClassStateChanged(nearlyExpired, isNearlyDue)); row.itemProperty().addListener((obs, oldBill, newBill) -> { nearlyDueProperty.unbind(); if (newBill == null) { nearlyDueProperty.set(false); } else { // bind nearlyDueProperty to the time between the current Bill's // paymentDate and expirationDate // true if less than 7 days, false otherwise: nearlyDueProperty.bind(Bindings.createBooleanBinding(() -> newBill.getExpirationDate().minusDays(7).isBefore(newBill.getPaymentDate()), newBill.expirationDateProperty(), newBill.paymentDateProperty())); } }); return row ; });
if (newValue) { if(scanningDone.isBound()){ scanningDone.unbind();
private void unbindScrollBar(ScrollBar bar) { bar.maxProperty().unbind(); bar.unitIncrementProperty().unbind(); bar.blockIncrementProperty().unbind(); bar.visibleProperty().unbind(); }
/** * Stop managing zoom management by removing all event handlers and bindings, and hiding the * rectangle. */ public void stop() { handlerManager.removeAllHandlers(); selecting.set( false ); selectRect.widthProperty().unbind(); selectRect.heightProperty().unbind(); selectRect.visibleProperty().unbind(); }
@Override public void dispose() { box.highlightTextFillProperty().unbind(); box.wrapTextProperty().unbind(); box.graphicFactoryProperty().unbind(); box.graphicOffset.unbind(); firstParPseudoClass.unsubscribe(); lastParPseudoClass.unsubscribe(); caretSubscription.unsubscribe(); hasCaretPseudoClass.unsubscribe(); selectionSubscription.unsubscribe(); } };
row.pseudoClassStateChanged(nearlyExpired, isNearlyDue)); row.itemProperty().addListener((obs, oldBill, newBill) -> { nearlyDueProperty.unbind(); if (newBill == null) { nearlyDueProperty.set(false);
@Override public void changed( ObservableValue<? extends Service<?>> observableValue, Service<?> oldValue, Service<?> newValue) { try { if (oldValue != null) { taskTitleLabel.textProperty().unbind(); taskMessageLabel.textProperty().unbind(); taskProgress.progressProperty().unbind(); killTaskButton.visibleProperty().unbind(); } if (newValue != null) { taskTitleLabel.textProperty().bind(newValue.titleProperty()); taskMessageLabel.textProperty().bind(newValue.messageProperty()); taskProgress.progressProperty().bind(newValue.progressProperty()); newValue.progressProperty().addListener((e) -> System.out.println("Changed: " + newValue.progressProperty().get())); if (newValue instanceof DataFxService<?>) { killTaskButton.visibleProperty().bind(((DataFxService<?>) newValue).cancelableProperty()); } else { killTaskButton.visibleProperty().set(true); } anchorPane.setVisible(true); } else { anchorPane.setVisible(false); } } catch (Exception e) { e.printStackTrace(); } } });
@Override public void changed( ObservableValue<? extends Service<?>> observableValue, Service<?> oldValue, Service<?> newValue) { try { if (oldValue != null) { taskTitleLabel.textProperty().unbind(); taskMessageLabel.textProperty().unbind(); taskProgress.progressProperty().unbind(); killTaskButton.visibleProperty().unbind(); } if (newValue != null) { taskTitleLabel.textProperty().bind(newValue.titleProperty()); taskMessageLabel.textProperty().bind(newValue.messageProperty()); taskProgress.progressProperty().bind(newValue.progressProperty()); if (newValue instanceof DataFxService<?>) { killTaskButton.visibleProperty().bind(((DataFxService<?>) newValue).cancelableProperty()); } else { killTaskButton.visibleProperty().set(true); } anchorPane.setVisible(true); } else { anchorPane.setVisible(false); } } catch (Exception e) { e.printStackTrace(); } } });