4 * Copyright 2009, Moxiecode Systems AB
5 * Released under LGPL License.
7 * License: http://tinymce.moxiecode.com/license
8 * Contributing: http://tinymce.moxiecode.com/contributing
12 var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk;
15 * This class is base class for all menu item types like DropMenus items etc. This class should not
16 * be instantiated directly other menu items should inherit from this one.
18 * @class tinymce.ui.MenuItem
19 * @extends tinymce.ui.Control
21 tinymce.create('tinymce.ui.MenuItem:tinymce.ui.Control', {
23 * Constructs a new button control instance.
27 * @param {String} id Button control id for the button.
28 * @param {Object} s Optional name/value settings object.
30 MenuItem : function(id, s) {
32 this.classPrefix = 'mceMenuItem';
36 * Sets the selected state for the control. This will add CSS classes to the
37 * element that contains the control. So that it can be selected visually.
40 * @param {Boolean} s Boolean state if the control should be selected or not.
42 setSelected : function(s) {
43 this.setState('Selected', s);
44 this.setAriaProperty('checked', !!s);
49 * Returns true/false if the control is selected or not.
52 * @return {Boolean} true/false if the control is selected or not.
54 isSelected : function() {
59 * Post render handler. This function will be called after the UI has been
60 * rendered so that events can be added.
64 postRender : function() {
71 t.setSelected(t.selected);