package devopsdistilled.operp.client.stock;

import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.inject.Inject;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;

import net.miginfocom.swing.MigLayout;
import devopsdistilled.operp.client.abstracts.TaskPane;
import devopsdistilled.operp.client.stock.controllers.StockController;
import devopsdistilled.operp.client.stock.controllers.WarehouseController;

public class StockMgmtPane extends TaskPane {

	@Inject
	private StockController stockController;

	@Inject
	private WarehouseController warehouseController;

	private JButton btnListStock;
	private JButton btnCreateStock;
	private JButton btnCreateWarehouse;
	private JButton btnListWarehouse;
	private JButton btnTransferStock;

	@Override
	public String toString() {
		return new String("Stock Management");
	}

	/**
	 * @wbp.parser.entryPoint
	 */

	@Override
	public JComponent getPane() {
		JPanel pane = new JPanel();
		pane.setLayout(new MigLayout("", "[]20[]", "[][][][][]"));

		JLabel lblStockManagement = new JLabel("Stock Management");
		lblStockManagement.setFont(new Font("Dialog", Font.BOLD, 16));
		pane.add(lblStockManagement, "cell 0 0 2 1,alignx center");

		btnCreateStock = new JButton("Update Stock");
		btnCreateStock.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				stockController.create();

			}

		});
		pane.add(btnCreateStock, "flowx,cell 0 1");

		btnCreateWarehouse = new JButton("Create Warehouse");
		btnCreateWarehouse.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				warehouseController.create();
			}
		});

		btnListStock = new JButton("List Stock");
		btnListStock.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				stockController.list();
			}
		});

		pane.add(btnListStock, "cell 1 1");

		pane.add(btnCreateWarehouse, "flowx,cell 0 2");

		btnListWarehouse = new JButton("List Warehouse");
		btnListWarehouse.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				warehouseController.list();
			}
		});
		pane.add(btnListWarehouse, "cell 1 2");

		btnTransferStock = new JButton("Transfer Stock");
		btnTransferStock.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				stockController.transfer();
			}
		});
		pane.add(btnTransferStock, "cell 0 4");

		return pane;

	}

}

@@ -426,24 +426,30 @@
 ollers.Stock
+Keeper
 Controller;%0A
@@ -448,16 +448,16 @@
 roller;%0A
-
 import d
@@ -590,24 +590,30 @@
 rivate Stock
+Keeper
 Controller s
@@ -612,24 +612,30 @@
 roller stock
+Keeper
 Controller;%0A
@@ -1481,32 +1481,38 @@
 t e) %7B%0A%09%09%09%09stock
+Keeper
 Controller.creat
@@ -1516,17 +1516,16 @@
 eate();%0A
-%0A
 %09%09%09%7D%0A%0A%09%09
@@ -1963,32 +1963,38 @@
 t e) %7B%0A%09%09%09%09stock
+Keeper
 Controller.list(
@@ -2525,32 +2525,32 @@
 ctionEvent e) %7B%0A
-
 %09%09%09%09stockControl
@@ -2542,16 +2542,22 @@
 %09%09%09stock
+Keeper
 Controll

Use StockKeeper instead of Stock