Ejemplo n.º 1
0
  private void setReceiptBinds() {
    ContentView view = viewDisplay.getView(receiptPane);
    BindingGroup group = btnToReceipt.getBindingGroup();
    group.addBinding(purchasePaneController.getBindings().and(PURCHASE_VIEW_ACTIVE));

    view.getBindingGroup().setAll(group.getBinds());
  }
Ejemplo n.º 2
0
  private void setCredentialBinds() {
    ContentView view = viewDisplay.getView(credentialsPane);

    BindingGroup group = btnToCredentials.getBindingGroup();
    group.addBinding(CART_NONEMPTY.and(not(RECEIPT_VIEW_ACTIVE)));
    group
        .getState()
        .addListener(
            (obs, o, n) -> {
              ContentView storeView = viewDisplay.getView(storePane);
              ContentView receiptView = viewDisplay.getView(storePane);
              ContentView currentView = viewDisplay.getCurrentView().getValue();

              if (not(CART_NONEMPTY).get()
                  && !currentView.equals(storeView)
                  && !currentView.equals(receiptView)) viewDisplay.show(storeView);

              btnToCredentials.setDisable(true);
            });

    view.getBindingGroup().setAll(group.getBinds());
  }