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