package devopsdistilled.operp.client.items;

import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;

import net.miginfocom.swing.MigLayout;
import devopsdistilled.operp.client.abstracts.SubTaskPane;

public class ListItemPane extends SubTaskPane implements ListItemModelObserver {

	private final ListItemPaneController controller;
	private final ListItemModel model;

	private JPanel pane;
	private JTable table;
	private ItemTableModel tableModel;

	public ListItemPane(ListItemPaneController controller, ListItemModel model) {
		this.controller = controller;

		this.model = model;
		model.registerObserver(this);
	}

	/**
	 * @wbp.parser.entryPoint
	 */
	@Override
	public void init() {
		pane = new JPanel(new MigLayout("debug, fill"));

		tableModel = new ItemTableModel();
		table = new JTable(tableModel);

		final JScrollPane scrollPane = new JScrollPane(table,
				JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
				JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);

		pane.add(scrollPane, "grow");

		controller.loadData();
	}

	@Override
	public void updateAll() {
		// TODO Auto-generated method stub

	}

	@Override
	public JComponent getPane() {
		return pane;
	}

	@Override
	public void updateItemList() {
		tableModel.setItems(model.getItems());
	}

}

@@ -35,16 +35,22 @@
 nt.items
+.views
 ;%0A%0Aimpor
@@ -259,16 +259,238 @@
 askPane;
+%0Aimport devopsdistilled.operp.client.items.ItemTableModel;%0Aimport devopsdistilled.operp.client.items.controllers.ListItemPaneController;%0Aimport devopsdistilled.operp.client.items.models.observers.ListItemPaneModelObserver;
 %0A%0Apublic
@@ -539,25 +539,27 @@
 plements
- 
+%0A%09%09
 ListItem
 ModelObs
@@ -546,24 +546,28 @@
 s%0A%09%09ListItem
+Pane
 ModelObserve
@@ -667,16 +667,22 @@
 private 
+final 
 JPanel p
@@ -695,16 +695,22 @@
 private 
+final 
 JTable t
@@ -724,16 +724,22 @@
 private 
+final 
 ItemTabl
@@ -783,223 +783,8 @@
 ane(
-ListItemPaneController controller, ListItemModel model) %7B%0A%09%09this.controller = controller;%0A%0A%09%09this.model = model;%0A%09%09model.registerObserver(this);%0A%09%7D%0A%0A%09/**%0A%09 * @wbp.parser.entryPoint%0A%09 */%0A%09@Override%0A%09public void init(
 ) %7B%0A
@@ -1090,16 +1090,53 @@
 %22grow%22);
+%0A%09%7D%0A%0A%09@Override%0A%09public void init() %7B
 %0A%0A%09%09cont

Initialize and layout Pane components