package devopsdistilled.operp.client.context;

import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Scope;

import devopsdistilled.operp.client.items.ItemModel;
import devopsdistilled.operp.client.items.ItemModelImpl;
import devopsdistilled.operp.client.items.ItemPane;
import devopsdistilled.operp.client.items.ItemPaneController;
import devopsdistilled.operp.client.items.ItemPaneControllerImpl;
import devopsdistilled.operp.client.main.MainModel;
import devopsdistilled.operp.client.main.MainModelImpl;
import devopsdistilled.operp.client.main.MainWindow;
import devopsdistilled.operp.client.main.MainWindowController;
import devopsdistilled.operp.client.main.MainWindowControllerImpl;

@Configuration
@Import({ NavigationContext.class })
public class UIContext {

	@Bean
	public MainWindowController mainWindowController() {
		return new MainWindowControllerImpl();
	}

	@Bean
	public MainModel mainModel() {
		return new MainModelImpl();
	}

	@Bean
	public MainWindow mainWindow() {
		MainWindow window = MainWindow.getInstance();
		return window;
	}

	@Bean()
	@Scope(value = BeanDefinition.SCOPE_PROTOTYPE)
	public ItemModel itemModel() {
		return new ItemModelImpl();
	}

	@Bean
	@Scope(value = BeanDefinition.SCOPE_PROTOTYPE)
	public ItemPaneController itemPaneController() {
		return new ItemPaneControllerImpl();
	}

	@Bean
	@Scope(value = BeanDefinition.SCOPE_PROTOTYPE)
	public ItemPane itemPane() {
		ItemPaneController controller = itemPaneController();
		ItemModel model = controller.getModel();
		return new ItemPane(controller, model);
	}
}

@@ -611,24 +611,334 @@
 rollerImpl;%0A
+import devopsdistilled.operp.client.items.ListItemModel;%0Aimport devopsdistilled.operp.client.items.ListItemModelImpl;%0Aimport devopsdistilled.operp.client.items.ListItemPane;%0Aimport devopsdistilled.operp.client.items.ListItemPaneController;%0Aimport devopsdistilled.operp.client.items.ListItemPaneControllerImpl;%0A
 import devop
@@ -973,24 +973,24 @@
 .MainModel;%0A
-
 import devop
@@ -1590,18 +1590,16 @@
 %0A%0A%09@Bean
-()
 %0A%09@Scope
@@ -2079,13 +2079,561 @@
 model);%0A
-
 %09%7D%0A
+%0A%09@Bean%0A%09@Scope(value = BeanDefinition.SCOPE_PROTOTYPE)%0A%09public ListItemModel listItemModel() %7B%0A%09%09return new ListItemModelImpl();%0A%09%7D%0A%0A%09@Bean%0A%09@Scope(value = BeanDefinition.SCOPE_PROTOTYPE)%0A%09public ListItemPaneController listItemPaneController() %7B%0A%09%09return new ListItemPaneControllerImpl();%0A%09%7D%0A%0A%09@Bean%0A%09@Scope(value = BeanDefinition.SCOPE_PROTOTYPE)%0A%09public ListItemPane listItemPane() %7B%0A%09%09ListItemPaneController controller = listItemPaneController();%0A%09%09ListItemModel model = controller.getModel();%0A%09%09return new ListItemPane(controller, model);%0A%09%7D%0A%0A
 %7D%0A

Configure "ListItemPane" MVC for ApplicationContext