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(name: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
ControlManager
public function ControlManager(ed:Editor, s:Object)
Constructs a new control manager instance. Consult the Wiki for more details on this class.
Parameters
Param | Detail |
---|---|
ed:Editor | TinyMCE editor instance to add the control to. |
s:Object | Optional settings object for the control manager. |
add
public function add(Control:Control):Control
Adds a control to the control collection inside the manager.
Parameters
Param | Detail |
---|---|
Control:Control | instance to add to collection. |
Returns
Control - Control instance that got passed in.
createButton
public function createButton(id:String, s:Object, cc:Object):Control
Creates a button control instance by id.
Parameters
Param | Detail |
---|---|
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.
createColorSplitButton
public function createColorSplitButton(id:String, s:Object, cc:Object):Control
Creates a color split button control instance by id.
Parameters
Param | Detail |
---|---|
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.
createControl
public function createControl(name: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
Param | Detail |
---|---|
name:String | Control name to create for example "separator". |
Returns
Control - Control instance that got created and added.
createDropMenu
public function createDropMenu(id:String, s:Object, cc:Object):Control
Creates a drop menu control instance by id.
Parameters
Param | Detail |
---|---|
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.
createListBox
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
Param | Detail |
---|---|
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.
createMenuButton
public function createMenuButton(id:String, s:Object, cc:Object):Control
Creates a menu button control instance by id.
Parameters
Param | Detail |
---|---|
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.
createSeparator
public function createSeparator(cc:Object):Control
Creates a separator control instance.
Parameters
Param | Detail |
---|---|
cc:Object | Optional control class to use instead of the default one. |
Returns
Control - Control instance that got created and added.
createSplitButton
public function createSplitButton(id:String, s:Object, cc:Object):Control
Creates a split button control instance by id.
Parameters
Param | Detail |
---|---|
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.
createToolbar
public function createToolbar(id:String, s:Object, cc:Object):Control
Creates a toolbar container control instance by id.
Parameters
Param | Detail |
---|---|
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.
destroy
public function destroy():void
Destroy.
get
public function get(id:String):Control
Returns a control by id or undefined it it wasn't found.
Parameters
Param | Detail |
---|---|
id:String | Control instance name. |
Returns
Control - Control instance or undefined.
setActive
public function setActive(id:String, s:Boolean):Control
Sets the active state of a control by id.
Parameters
Param | Detail |
---|---|
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.
setControlType
public function setControlType(n:string, c:function):function
Overrides a specific control type with a custom class.
Parameters
Param | Detail |
---|---|
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.
setDisabled
public function setDisabled(id:String, s:Boolean):Control
Sets the dsiabled state of a control by id.
Parameters
Param | Detail |
---|---|
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.
Was this article helpful? Yes - No
Well, that's awkward . Would you mind opening an issue or helping us out?
Thanks for the feedback!
Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under the Apache 2.0 License.