@@ -148,6 +148,15 @@ define(function (require, exports, module) {
148148 return this . _enabled ;
149149 } ;
150150
151+ /**
152+ * get the command options
153+ *
154+ * @return {object }
155+ */
156+ Command . prototype . getOptions = function ( ) {
157+ return this . _options || { } ;
158+ } ;
159+
151160 /**
152161 * Sets enabled state of Command and dispatches "enabledStateChange"
153162 * when the enabled state changes.
@@ -196,11 +205,17 @@ define(function (require, exports, module) {
196205 * use \uXXXX instead of an HTML entity.
197206 *
198207 * @param {string } name
208+ * @param {string } htmlName If set, this will be displayed in ui menus instead of the name given.
209+ * Eg. "Phoenix menu<i class='fa fa-car' style='margin-left: 4px;'></i>"
199210 */
200- Command . prototype . setName = function ( name ) {
201- var changed = this . _name !== name ;
211+ Command . prototype . setName = function ( name , htmlName ) {
212+ let changed = this . _name !== name ;
202213 this . _name = name ;
203214
215+ if ( htmlName && this . _options . htmlName !== htmlName ) {
216+ changed = true ;
217+ this . _options . htmlName = htmlName ;
218+ }
204219 if ( changed ) {
205220 this . trigger ( "nameChange" ) ;
206221 }
@@ -233,6 +248,8 @@ define(function (require, exports, module) {
233248 * @param {boolean } options.eventSource If set to true, the commandFn will be called with the first argument `event`
234249 * with details about the source(invoker) as event.eventSource(one of the `CommandManager.SOURCE_*`) and
235250 * event.sourceType(Eg. Ctrl-K) parameter.
251+ * @param {string } options.htmlName If set, this will be displayed in ui menus instead of the name given.
252+ * Eg. "Phoenix menu<i class='fa fa-car' style='margin-left: 4px;'></i>"
236253 * @return {?Command }
237254 */
238255 function register ( name , id , commandFn , options = { } ) {
0 commit comments