package devopsdistilled.operp.client.items;

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

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
	 */
	public void init() {
		pane = new JPanel();
		tableModel = new ItemTableModel();
		table = new JTable(tableModel);
		pane.add(new JScrollPane(table));

		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());
	}

	
}

@@ -38,16 +38,81 @@
 items;%0A%0A
+import java.awt.BorderLayout;%0A%0Aimport javax.swing.BorderFactory;%0A
 import j
@@ -134,16 +134,16 @@
 ponent;%0A
-
 import j
@@ -765,31 +765,9 @@
 ) %7B%0A
-%09%09pane = new JPanel();
 %0A
+
 %09%09ta
@@ -839,39 +839,274 @@
 ;%0A%09%09
-pane.add(new JScrollPane(table)
+final JScrollPane scrollPane = new JScrollPane(table,%0A%09%09%09%09JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,%0A%09%09%09%09JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);%0A%0A%09%09pane = new JPanel(new BorderLayout());%0A%09%09pane.setBorder(BorderFactory.createEmptyBorder());%0A%0A%09%09pane.add(scrollPane
 );%0A%0A
@@ -1367,8 +1367,6 @@
 %09%7D%0A%0A
-%09%0A
 %7D%0A

Add scrollPane to pane with variable declared