/**
 * @class Roo.gui.ActionPanel
 * @extends Ext.Panel
 *
 * The ActionPanel is located left in the application.
 * It contains the search an minimap panels, to enable an user to find plans.
 *
 * @author ssmeman
 * @version 1.0
 */

/**
 * @constructor
 * @param {Object} config Configuration options
 */
Roo.gui.ActionPanel = Ext.extend(Ext.Panel, {

	// soft config ( can be changed from outside)
	region: 'west'
	,split: false
	,bodyStyle:'position:relative;'	/* fixes scroll problem with IE */

	,defaults: {
		width: 205
		,frame: true
		,style: 'margin:2px 2px'
		,animCollapse: false	/* fixes collapse problem in IE */
	}

	,initComponent: function() {

		// hard coded
		var config = {
			id: 'action-panel'
			,baseCls: 'x-plain'
			,width: 209

			,items: [{
				xtype: 'tabpanel'
				,id: 'searchPanel'
				,activeItem: 0
				,animCollapse: false
				,collapsed: false
				,deferredRender: false
				,plain : true
				,defaults: {
					padding: '4px'
					,animCollapse: false
				}
				,items: [{
					xtype: 'searchLocationPanel'
				},{
					xtype: 'searchNamePanel'
				},{
					xtype: 'searchPlanIdPanel'
				},{
					xtype: 'searchCriteriaPanel'
				}]
			},{
				xtype: 'designSelectPanel'
			},{
				xtype: 'minimapPanel'
			}]
		};

		// apply config
		Ext.apply(this, config);
		Ext.apply(this.initialConfig, config);

		// call parent
		Roo.gui.ActionPanel.superclass.initComponent.apply(this, arguments);

		eventHub.on({
			scope : this,
			'changedFilter' : function(parameters) {
				var filter = parameters.filter;

				switch(filter) {
				case 'JURIDISCH':
				case 'ACTUEEL':
					Ext.getCmp('designSelectPanel').show();
					Ext.getCmp('designSelectPanel').expand();
					break;
				case 'NONE':
					// do nothing
					break;
				default:
					Ext.getCmp('designSelectPanel').hide();
					break;
				}
			}
		});
	}	// e/o initComponent
});

//register xtype
Ext.reg('actionPanel', Roo.gui.ActionPanel);
