Exemplo n.º 1
0
  public final void onAddProduct(T o, int quantity) {
    if (quantity == 0) {
      System.err.println("Quantity was zero");
      layout.setInfoLabel("Quantity has to be not equal to 0;");
      return;
    }

    refreshCartView(addProduct(o, quantity));
  }
Exemplo n.º 2
0
 private void refreshCartView(List<CartItem> items) {
   layout.setCartModel(new CartTableModel(items.toArray(new CartItem[items.size()])));
 }
Exemplo n.º 3
0
 public void refreshProductList() {
   layout.removeAllProducts();
   for (ComboBoxObject<T> obj : getLatestProductList()) {
     layout.addProduct(obj);
   }
 }
Exemplo n.º 4
0
  public Client(String name) {
    this.layout = new ClientLayout(this, name);

    refreshProductList();
    layout.setVisible(true);
  }