//>>built
define("dijit/_editor/_Plugin",["dojo/_base/connect","dojo/_base/declare","dojo/_base/lang","../Destroyable","../form/Button"],function(k,d,e,l,m){d=d("dijit._editor._Plugin",l,{constructor:function(a){this.params=a||{};e.mixin(this,this.params);this._attrPairNames={}},editor:null,iconClassPrefix:"dijitEditorIcon",button:null,command:"",useDefaultCommand:!0,buttonClass:m,disabled:!1,getLabel:function(a){return this.editor.commands[a]},_initButton:function(){if(this.command.length){var a=this.getLabel(this.command),
b=this.editor,c=this.iconClassPrefix+" "+this.iconClassPrefix+this.command.charAt(0).toUpperCase()+this.command.substr(1);this.button||(a=e.mixin({label:a,ownerDocument:b.ownerDocument,dir:b.dir,lang:b.lang,showLabel:!1,iconClass:c,dropDown:this.dropDown,tabIndex:"-1"},this.params||{}),delete a.name,this.button=new this.buttonClass(a))}this.get("disabled")&&this.button&&this.button.set("disabled",this.get("disabled"))},destroy:function(){this.dropDown&&this.dropDown.destroyRecursive();this.inherited(arguments)},
connect:function(a,b,c){this.own(k.connect(a,b,this,c))},updateState:function(){var a=this.editor,b=this.command;if(a&&a.isLoaded&&b.length){var c=this.get("disabled");if(this.button)try{var f=a._implCommand(b);var g=!c&&(this[f]?this[f](b):a.queryCommandEnabled(b));this.enabled!==g&&(this.enabled=g,this.button.set("disabled",!g));if(g&&"boolean"==typeof this.button.checked){var h=a.queryCommandState(b);this.checked!==h&&(this.checked=h,this.button.set("checked",a.queryCommandState(b)))}}catch(n){}}},
setEditor:function(a){this.editor=a;this._initButton();this.button&&this.useDefaultCommand&&(this.editor.queryCommandAvailable(this.command)?this.own(this.button.on("click",e.hitch(this.editor,"execCommand",this.command,this.commandArg))):this.button.domNode.style.display="none");this.own(this.editor.on("NormalizedDisplayChanged",e.hitch(this,"updateState")))},setToolbar:function(a){this.button&&a.addChild(this.button)},set:function(a,b){if("object"===typeof a){for(var c in a)this.set(c,a[c]);return this}c=
this._getAttrNames(a);if(this[c.s])var f=this[c.s].apply(this,Array.prototype.slice.call(arguments,1));else this._set(a,b);return f||this},get:function(a){var b=this._getAttrNames(a);return this[b.g]?this[b.g]():this[a]},_setDisabledAttr:function(a){this._set("disabled",a);this.updateState()},_getAttrNames:function(a){var b=this._attrPairNames;if(b[a])return b[a];var c=a.charAt(0).toUpperCase()+a.substr(1);return b[a]={s:"_set"+c+"Attr",g:"_get"+c+"Attr"}},_set:function(a,b){this[a]=b}});d.registry=
{};return d});