# tinymce.ControlManager

Namespace | tinymce
Class | ControlManager

This class is responsible for managing UI control instances. It's both a factory and a collection for the controls.

## Public Methods

Method | Defined By
--- | ---
ControlManager(ed:Editor, s:Object) Constructs a new control manager instance. | ControlManager
add(Control:Control):Control Adds a control to the control collection inside the manager. | ControlManager
createButton(id:String, s:Object, cc:Object):Control Creates a button control instance by id. | ControlManager
createColorSplitButton(id:String, s:Object, cc:Object):Control Creates a color split button control instance by id. | ControlManager
createControl(n:String):Control Creates a control by name, when a control is created it will automatically add it to the control collection. | ControlManager
createDropMenu(id:String, s:Object, cc:Object):Control Creates a drop menu control instance by id. | ControlManager
createListBox(id:String, s:Object, cc:Object):Control Creates a list box control instance by id. | ControlManager
createMenuButton(id:String, s:Object, cc:Object):Control Creates a menu button control instance by id. | ControlManager
createSeparator(cc:Object):Control Creates a separator control instance. | ControlManager
createSplitButton(id:String, s:Object, cc:Object):Control Creates a split button control instance by id. | ControlManager
createToolbar(id:String, s:Object, cc:Object):Control Creates a toolbar container control instance by id. | ControlManager
destroy():void Destroy. | ControlManager
get(id:String):Control Returns a control by id or undefined it it wasn't found. | ControlManager
setActive(id:String, s:Boolean):Control Sets the active state of a control by id. | ControlManager
setControlType(n:string, c:function):function Overrides a specific control type with a custom class. | ControlManager
setDisabled(id:String, s:Boolean):Control Sets the dsiabled state of a control by id. | ControlManager

## Method details

### ControlManagerconstructor

`public function ControlManager(ed:Editor, s:Object)`
Constructs a new control manager instance. Consult the Wiki for more details on this class.

#### Parameters

ed:Editor | TinyMCE editor instance to add the control to.
s:Object | Optional settings object for the control manager.

### addmethod

`public function add(Control:Control):Control`
Adds a control to the control collection inside the manager.

#### Parameters

Control:Control | instance to add to collection.

#### Returns

Control - Control instance that got passed in.

### createButtonmethod

`public function createButton(id:String, s:Object, cc:Object):Control`
Creates a button control instance by id.

#### Parameters

id:String | Unique id for the new button instance. For example "bold".
s:Object | Optional settings object for the control.
cc:Object | Optional control class to use instead of the default one.

#### Returns

Control - Control instance that got created and added.

### createColorSplitButtonmethod

`public function createColorSplitButton(id:String, s:Object, cc:Object):Control`
Creates a color split button control instance by id.

#### Parameters

id:String | Unique id for the new color split button instance. For example "forecolor".
s:Object | Optional settings object for the control.
cc:Object | Optional control class to use instead of the default one.

#### Returns

Control - Control instance that got created and added.

### createControlmethod

`public function createControl(n:String):Control`
Creates a control by name, when a control is created it will automatically add it to the control collection. It first ask all plugins for the specified control if the plugins didn't return a control then the default behavior will be used.

#### Parameters

n:String | Control name to create for example "separator".

#### Returns

Control - Control instance that got created and added.

### createDropMenumethod

`public function createDropMenu(id:String, s:Object, cc:Object):Control`
Creates a drop menu control instance by id.

#### Parameters

id:String | Unique id for the new dropdown instance. For example "some menu".
s:Object | Optional settings object for the control.
cc:Object | Optional control class to use instead of the default one.

#### Returns

Control - Control instance that got created and added.

### createListBoxmethod

`public function createListBox(id:String, s:Object, cc:Object):Control`
Creates a list box control instance by id. A list box is either a native select element or a DOM/JS based list box control. This depends on the use_native_selects settings state.

#### Parameters

id:String | Unique id for the new listbox instance. For example "styles".
s:Object | Optional settings object for the control.
cc:Object | Optional control class to use instead of the default one.

#### Returns

Control - Control instance that got created and added.

### createMenuButtonmethod

`public function createMenuButton(id:String, s:Object, cc:Object):Control`
Creates a menu button control instance by id.

#### Parameters

id:String | Unique id for the new menu button instance. For example "menu1".
s:Object | Optional settings object for the control.
cc:Object | Optional control class to use instead of the default one.

#### Returns

Control - Control instance that got created and added.

### createSeparatormethod

`public function createSeparator(cc:Object):Control`
Creates a separator control instance.

#### Parameters

cc:Object | Optional control class to use instead of the default one.

#### Returns

Control - Control instance that got created and added.

### createSplitButtonmethod

`public function createSplitButton(id:String, s:Object, cc:Object):Control`
Creates a split button control instance by id.

#### Parameters

id:String | Unique id for the new split button instance. For example "spellchecker".
s:Object | Optional settings object for the control.
cc:Object | Optional control class to use instead of the default one.

#### Returns

Control - Control instance that got created and added.

### createToolbarmethod

`public function createToolbar(id:String, s:Object, cc:Object):Control`
Creates a toolbar container control instance by id.

#### Parameters

id:String | Unique id for the new toolbar container control instance. For example "toolbar1".
s:Object | Optional settings object for the control.
cc:Object | Optional control class to use instead of the default one.

#### Returns

Control - Control instance that got created and added.

### destroymethod

`public function destroy():void`
Destroy.

### getmethod

`public function get(id:String):Control`
Returns a control by id or undefined it it wasn't found.

#### Parameters

id:String | Control instance name.

#### Returns

Control - Control instance or undefined.

### setActivemethod

`public function setActive(id:String, s:Boolean):Control`
Sets the active state of a control by id.

#### Parameters

id:String | Control id to set state on.
s:Boolean | Active state true/false.

#### Returns

Control - Control instance that got activated or null if it wasn't found.

### setControlTypemethod

`public function setControlType(n:string, c:function):function`
Overrides a specific control type with a custom class.

#### Parameters

n:string | Name of the control to override for example button or dropmenu.
c:function | Class reference to use instead of the default one.

#### Returns

function - Same as the class reference.

### setDisabledmethod

`public function setDisabled(id:String, s:Boolean):Control`
Sets the dsiabled state of a control by id.

#### Parameters

id:String | Control id to set state on.
s:Boolean | Active state true/false.

#### Returns

Control - Control instance that got disabled or null if it wasn't found.