0 results found

tinymce.ControlManager

Contribute to this page
Namespacetinymce
ClassControlManager

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

Public Methods

MethodDefined 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

ParamDetail
ed:EditorTinyMCE editor instance to add the control to.
s:ObjectOptional settings object for the control manager.

add

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

Parameters

ParamDetail
Control:Controlinstance 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

ParamDetail
id:StringUnique id for the new button instance. For example "bold".
s:ObjectOptional settings object for the control.
cc:ObjectOptional 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

ParamDetail
id:StringUnique id for the new color split button instance. For example "forecolor".
s:ObjectOptional settings object for the control.
cc:ObjectOptional 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

ParamDetail
name:StringControl 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

ParamDetail
id:StringUnique id for the new dropdown instance. For example "some menu".
s:ObjectOptional settings object for the control.
cc:ObjectOptional 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

ParamDetail
id:StringUnique id for the new listbox instance. For example "styles".
s:ObjectOptional settings object for the control.
cc:ObjectOptional 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

ParamDetail
id:StringUnique id for the new menu button instance. For example "menu1".
s:ObjectOptional settings object for the control.
cc:ObjectOptional 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

ParamDetail
cc:ObjectOptional 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

ParamDetail
id:StringUnique id for the new split button instance. For example "spellchecker".
s:ObjectOptional settings object for the control.
cc:ObjectOptional 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

ParamDetail
id:StringUnique id for the new toolbar container control instance. For example "toolbar1".
s:ObjectOptional settings object for the control.
cc:ObjectOptional 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

ParamDetail
id:StringControl 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

ParamDetail
id:StringControl id to set state on.
s:BooleanActive 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

ParamDetail
n:stringName of the control to override for example button or dropmenu.
c:functionClass 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

ParamDetail
id:StringControl id to set state on.
s:BooleanActive state true/false.

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

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.