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.ItemController;
import devopsdistilled.operp.client.items.ItemControllerImpl;
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.items.ListItemModel;
import devopsdistilled.operp.client.items.ListItemModelImpl;
import devopsdistilled.operp.client.items.ListItemPane;
import devopsdistilled.operp.client.items.ListItemPaneController;
import devopsdistilled.operp.client.items.ListItemPaneControllerImpl;
import devopsdistilled.operp.client.items.controllers.CreateItemPaneController;
import devopsdistilled.operp.client.items.controllers.impl.CreateItemPaneControllerImpl;
import devopsdistilled.operp.client.items.views.CreateItemPane;
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
	public ItemController itemController() {
		return new ItemControllerImpl();
	}

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

	@Bean
	@Scope(value = BeanDefinition.SCOPE_PROTOTYPE)
	public ListItemModel listItemModel() {
		return new ListItemModelImpl();
	}

	@Bean
	@Scope(value = BeanDefinition.SCOPE_PROTOTYPE)
	public ListItemPaneController listItemPaneController() {
		return new ListItemPaneControllerImpl();
	}

	@Bean
	@Scope(value = BeanDefinition.SCOPE_PROTOTYPE)
	public ListItemPane listItemPane() {
		ListItemPaneController controller = listItemPaneController();
		ListItemModel model = controller.getModel();
		return new ListItemPane(controller, model);
	}

	@Bean
	public devopsdistilled.operp.client.items.models.ItemModel itemModelNew() {
		return new devopsdistilled.operp.client.items.models.impl.ItemModelImpl();
	}

	@Bean
	public CreateItemPane createItemPane() {
		return new CreateItemPane();
	}

	@Bean
	public CreateItemPaneController createItemPaneController() {
		return new CreateItemPaneControllerImpl();
	}

}

@@ -44,72 +44,8 @@
 t;%0A%0A
-import org.springframework.beans.factory.config.BeanDefinition;%0A
 impo
@@ -210,61 +210,8 @@
 ort;
-%0Aimport org.springframework.context.annotation.Scope;
 %0A%0Aim
@@ -442,498 +442,8 @@
 pl;%0A
-import devopsdistilled.operp.client.items.ItemPane;%0Aimport devopsdistilled.operp.client.items.ItemPaneController;%0Aimport devopsdistilled.operp.client.items.ItemPaneControllerImpl;%0Aimport 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
 impo
@@ -1342,1278 +1342,140 @@
 an%0A%09
-@Scope(value = BeanDefinition.SCOPE_PROTOTYPE)%0A%09public ItemModel itemModel() %7B%0A%09%09return new ItemModelImpl();%0A%09%7D%0A%0A%09@Bean%0A%09public ItemController itemController() %7B%0A%09%09return new ItemControllerImpl();%0A%09%7D%0A%0A%09@Bean%0A%09@Scope(value = BeanDefinition.SCOPE_PROTOTYPE)%0A%09public ItemPaneController itemPaneController() %7B%0A%09%09return new ItemPaneControllerImpl();%0A%09%7D%0A%0A%09@Bean%0A%09@Scope(value = BeanDefinition.SCOPE_PROTOTYPE)%0A%09public ItemPane itemPane() %7B%0A%09%09ItemPaneController controller = itemPaneController();%0A%09%09ItemModel model = controller.getModel();%0A%09%09return new ItemPane(controller, 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%09@Bean%0A%09public devopsdistilled.operp.client.items.models.ItemModel itemModelNew() %7B%0A%09%09return new devopsdistilled.operp.client.items.models.impl.
+public ItemController itemController() %7B%0A%09%09return new ItemControllerImpl();%0A%09%7D%0A%0A%09@Bean%0A%09public ItemModel itemModel() %7B%0A%09%09return new 
 Item

Remove @Bean definition for obsolete classes