예제 #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());
  }
예제 #2
0
  private void setPurchaseBinds() {
    ContentView view = viewDisplay.getView(purchasePane);
    BindingGroup group = btnToPurchase.getBindingGroup();
    group.addBindings(
        credentialsPaneController.getBindings().and(CART_NONEMPTY).and(not(RECEIPT_VIEW_ACTIVE)));

    view.getBindingGroup().setAll(group.getBinds());
  }
예제 #3
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());
  }