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

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