tinymce.ui.Factory
This class is a factory for control instances. This enables you to create instances of controls without having to require the UI controls directly. It also allow you to override or add new control types.
Methods
name | summary | defined by |
---|---|---|
add() | Adds a new control instance type to the factory. | tinymce.ui.Factory |
create() | Creates a new control instance based on the settings provided. The instance created will be based on the specified type property it can also create whole structures of components out of the specified JSON object. | tinymce.ui.Factory |
get() | Returns ui control module by name. | tinymce.ui.Factory |
has() | Returns true/false if the specified type exists or not. | tinymce.ui.Factory |
Methods
add
add(type:String, typeClass:function)
Adds a new control instance type to the factory.
Parameters
- type (String) - Type name for example "button".
- typeClass (function) - Class type function.
create
create(settings:Object):tinymce.ui.Control
Creates a new control instance based on the settings provided. The instance created will be based on the specified type property it can also create whole structures of components out of the specified JSON object.
Examples
tinymce.ui.Factory.create({
type: 'button',
text: 'Hello world!'
});
Parameters
- settings (Object) - Name/Value object with items used to create the type.
Return value
- tinymce.ui.Control - Control instance based on the specified type.
get
get(type:String):Object
Returns ui control module by name.
Parameters
- type (String) - Type get.
Return value
- Object - Module or undefined.
has
has(type:String):Boolean
Returns true/false if the specified type exists or not.
Parameters
- type (String) - Type to look for.
Return value
- Boolean - true/false if the control by name exists.
Can't find what you're looking for? Let us know.
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.