0 results found

tinymce.ui.Control

Contribute to this page
Namespacetinymce.ui
ClassControl
SubclassesButton, Container, ListBox, MenuButton, MenuItem, Separator

This class is the base class for all controls like buttons, toolbars, containers. This class should not be instantiated directly other controls should inherit from this one.

Public Methods

MethodDefined By
Control(id:String, s:Object) : Constructs a new control instance.Control
destroy():void : Destroys the control will free any memory by removing event listeners etc.Control
isActive():Boolean : Returns true/false if the control is disabled or not.Control
isDisabled():Boolean : Returns true/false if the control is disabled or not.Control
isRendered():Boolean : Returns true/false if the control has been rendered or not.Control
postRender():void : Post render event.Control
remove():void : Removes the control.Control
renderHTML():String : Renders the control as a HTML string.Control
renderTo(n:Element):void : Renders the control to the specified container element.Control
setActive(s:Boolean):void : Sets the activated state for the control.Control
setDisabled(s:Boolean):void : Sets the disabled state for the control.Control
setState(c:String, s:Boolean):void : Sets the specified class state for the control.Control

Method details

Control

public function Control(id:String, s:Object)
Constructs a new control instance.

Parameters

ParamDetail
id:StringControl id.
s:ObjectOptional name/value settings object.

destroy

public function destroy():void
Destroys the control will free any memory by removing event listeners etc.

isActive

public function isActive():Boolean
Returns true/false if the control is disabled or not. This is a method since you can then choose to check some class or some internal bool state in subclasses.

Returns
Boolean - true/false if the control is disabled or not.

isDisabled

public function isDisabled():Boolean
Returns true/false if the control is disabled or not. This is a method since you can then choose to check some class or some internal bool state in subclasses.

Returns
Boolean - true/false if the control is disabled or not.

isRendered

public function isRendered():Boolean
Returns true/false if the control has been rendered or not.

Returns
Boolean - State if the control has been rendered or not.

postRender

public function postRender():void
Post render event. This will be executed after the control has been rendered and can be used to set states, add events to the control etc. It's recommended for subclasses of the control to call this method by using this.parent().

remove

public function remove():void
Removes the control. This means it will be removed from the DOM and any events tied to it will also be removed.

renderHTML

public function renderHTML():String
Renders the control as a HTML string. This method is much faster than using the DOM and when creating a whole toolbar with buttons it does make a lot of difference.

Returns
String - HTML for the button control element.

renderTo

public function renderTo(n:Element):void
Renders the control to the specified container element.

Parameters

ParamDetail
n:ElementHTML DOM element to add control to.

setActive

public function setActive(s:Boolean):void
Sets the activated state for the control. This will add CSS classes to the element that contains the control. So that it can be activated visually.

Parameters

ParamDetail
s:BooleanBoolean state if the control should be activated or not.

setDisabled

public function setDisabled(s:Boolean):void
Sets the disabled state for the control. This will add CSS classes to the element that contains the control. So that it can be disabled visually.

Parameters

ParamDetail
s:BooleanBoolean state if the control should be disabled or not.

setState

public function setState(c:String, s:Boolean):void
Sets the specified class state for the control.

Parameters

ParamDetail
c:StringClass name to add/remove depending on state.
s:BooleanTrue/false state if the class should be removed or added.

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.