Ext.ns('Nexts.plugins');

Nexts.plugins.TriggerFieldTooltip = function(config){
	Ext.apply(this, config);
};

Ext.extend(Nexts.plugins.TriggerFieldTooltip, Ext.util.Observable,{
	init: function(component){
		this.component = component;
		this.component.on('render', this.onRender, this);
	},
	
	//private
	onRender: function(){
		if(this.component.tooltip){
			if(typeof this.component.tooltip == 'object'){
				Ext.QuickTips.register(Ext.apply({
					  target: this.component.trigger
				}, this.component.tooltip));
			} else {
				this.component.trigger.dom[this.component.tooltipType] = this.component.tooltip;
			}
		}
	}
}); 
