@Override
	public void productContainerSelectionChanged() {
		if(getView().getSelectedProductContainer() == null){
			getView().setProducts(new ProductData[0]);
			return;
		}
		ProductContainer selectedContainer =
						(ProductContainer)getView().getSelectedProductContainer().getTag();
		List<ProductData> productDataList = new ArrayList<ProductData>();
		Collection<Product> products;
		if (selectedContainer != null) {
			products = sortProductByDescription(selectedContainer.getAllProducts());
		} else {
			products = sortProductByDescription(pController.getAllProducts());
		}
		
		for (Product product : products) {
			ProductData productData = new ProductData();
			productData.setBarcode(product.getBarCode().toString());
			int itemCount;
			if (selectedContainer != null) {
				itemCount = selectedContainer.getItemsByProduct(product).size();
			} else {
				try {
					itemCount = pController.getItemsByProduct(product).size();
				}
				catch(Exception e) {
					itemCount = 0;
					getView().displayErrorMessage(e.getMessage());
				}
			}
			productData.setCount(Integer.toString(itemCount));
			productData.setDescription(product.getDescription());
			productData.setShelfLife(product.getShelfLife() + " months");
			productData.setSize(SizeFormatter.format(product.getSize()));
			productData.setSupply(SizeFormatter.format(product.getThreeMonthSize()));
			productData.setTag(product);

			productDataList.add(productData);
		}

		getView().setProducts(productDataList.toArray(new ProductData[0]));
		
		getView().setItems(new ItemData[0]);
		getView().setContextSupply("");
		getView().setContextGroup("");
		getView().setContextUnit("");
		
		if (selectedContainer != null) {
			StorageUnit unit = selectedContainer.getStorageUnit();
			getView().setContextUnit(unit.getName());
			if (selectedContainer instanceof ProductGroup) {
				getView().setContextGroup(selectedContainer.getName());
				Size tmSupply = ((ProductGroup) selectedContainer).getThreeMonthSupply();
				getView().setContextSupply(SizeFormatter.format(tmSupply));
			}
		} else {
			getView().setContextUnit("All");
		}
	}