package devopsdistilled.operp.client.items;

import javax.inject.Inject;

import org.springframework.context.ApplicationContext;

import devopsdistilled.operp.client.items.controllers.CreateItemPaneController;
import devopsdistilled.operp.server.data.entity.items.Item;
import devopsdistilled.operp.server.data.service.items.ItemService;

public class ItemControllerImpl implements ItemController {

	@Inject
	private ApplicationContext context;

	@Inject
	private ItemService itemService;

	@Override
	public void createItem() {
		CreateItemPaneController createItemPaneController = context
				.getBean(CreateItemPaneController.class);
		createItemPaneController.init();
	}

	@Override
	public void editItem(Item item) {

	}

	@Override
	public void listItems() {
		ListItemPane listItemPane = context.getBean(ListItemPane.class);
		listItemPane.init();
		listItemPane.getDialog();
	}

	@Override
	public void deleteItem(Item item) {
		itemService.delete(item);
	}

}

@@ -203,16 +203,94 @@
 roller;%0A
+import devopsdistilled.operp.client.items.controllers.ListItemPaneController;%0A
 import d
@@ -752,59 +752,8 @@
 %09%7D%0A%0A
-%09@Override%0A%09public void editItem(Item item) %7B%0A%0A%09%7D%0A%0A
 %09@Ov
@@ -800,16 +800,26 @@
 ItemPane
+Controller
  listIte
@@ -823,16 +823,26 @@
 ItemPane
+Controller
  = conte
@@ -843,16 +843,21 @@
  context
+%0A%09%09%09%09
 .getBean
@@ -869,16 +869,26 @@
 ItemPane
+Controller
 .class);
@@ -906,44 +906,77 @@
 Pane
-.init();%0A%09%09listItemPane.getDialog();
+Controller.init();%0A%09%7D%0A%0A%09@Override%0A%09public void editItem(Item item) %7B%0A
 %0A%09%7D%0A

Define listItems() with new MVC model