Ext.define("Portfolio.designer.ui.wizard.view.Window", {
	extend: "Ext.window.Window",
	alias: "widget.designer.ui.wizard.view.window",
	layout: "fit",
	title: "Entity Wizard",
	config: {
		stack: null,
		designer: null
	},

	requires: [
		"Portfolio.designer.ui.wizard.controller.Window",
		"Portfolio.designer.ui.wizard.view.Main"
	],

	controller: "designer.ui.wizard.controller.window",

	bbar: [
		{
			xtype: "button",
			iconCls: "pf-arrow_left",
			itemId: "card-prev",
			text: "Previous",
			handler: "showPrevious",
			disabled: true
		},
		{
			xtype: "button",
			iconCls: "pf-arrow_right",
			itemId: "card-next",
			text: "Next",
			handler: "showNext"
		},
		"->",
		{
			xtype: "button",
			iconCls: "pf-floppy_disk",
			itemId: "card-save",
			text: "Save",
			hidden: true,
			handler: "onSave"
		}
	],

	initComponent: function() {

		var i_self = this;

		i_self.callParent(arguments);

		var i_main = Ext.widget("designer.ui.wizard.view.main", {
			designer: i_self.getDesigner()
		});

		i_self.setStack(i_main);

		i_self.add(i_main);
	}
});
