ReadonlyeditorThe editor instance.
Note that most editors implement the module:core/editor/editor~Editor#ui property. However, editors with an external UI (i.e. Bootstrap-based) or a headless editor may not have this property or throw an error when accessing it.
Because of above, to make plugins more universal, it is recommended to split features into:
ui property.ui property.ReadonlyisFlag indicating whether a plugin is enabled or disabled. A disabled plugin will not transform text.
Plugin can be simply disabled like that:
// Disable the plugin so that no toolbars are visible.
editor.plugins.get( 'TextTransformation' ).isEnabled = false;
You can also use #forceDisabled method.
StaticisStaticisStaticisClears forced disable previously set through #forceDisabled. See #forceDisabled.
Unique identifier, equal to the one passed in #forceDisabled call.
Destroys the plugin.
Note: This method is optional. A plugin instance does not need to have it defined.
Disables the plugin.
Plugin may be disabled by multiple features or algorithms (at once). When disabling a plugin, unique id should be passed (e.g. feature name). The same identifier should be used when #clearForceDisabled enabling back the plugin. The plugin becomes enabled only after all features #clearForceDisabled enabled it back.
Disabling and enabling a plugin:
plugin.isEnabled; // -> true
plugin.forceDisabled( 'MyFeature' );
plugin.isEnabled; // -> false
plugin.clearForceDisabled( 'MyFeature' );
plugin.isEnabled; // -> true
Plugin disabled by multiple features:
plugin.forceDisabled( 'MyFeature' );
plugin.forceDisabled( 'OtherFeature' );
plugin.clearForceDisabled( 'MyFeature' );
plugin.isEnabled; // -> false
plugin.clearForceDisabled( 'OtherFeature' );
plugin.isEnabled; // -> true
Multiple disabling with the same identifier is redundant:
plugin.forceDisabled( 'MyFeature' );
plugin.forceDisabled( 'MyFeature' );
plugin.clearForceDisabled( 'MyFeature' );
plugin.isEnabled; // -> true
Note: some plugins or algorithms may have more complex logic when it comes to enabling or disabling certain plugins, so the plugin might be still disabled after #clearForceDisabled was used.
Unique identifier for disabling. Use the same id when #clearForceDisabled enabling back the plugin.
The base class for CKEditor plugin classes.