Package wicket.contrib.tinymce4
Class TinyMceBehavior
- java.lang.Object
-
- org.apache.wicket.behavior.Behavior
-
- wicket.contrib.tinymce4.TinyMceBehavior
-
- All Implemented Interfaces:
Serializable,IComponentAwareEventSink,IComponentAwareHeaderContributor,IClusterable
public class TinyMceBehavior extends Behavior
Renders a component (textarea) as WYSIWYG editor, using TinyMce.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TinyMceBehavior()TinyMceBehavior(TinyMCESettings settings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbind(Component component)protected StringgetAddTinyMceSettingsScript(TinyMCESettings.Mode mode, Collection<Component> components)protected ComponentgetComponent()protected ResourceReferencegetTinyMCEReference()TinyMCE javascript resource.protected booleanisMarkupIdRequired()voidrenderHead(Component component, IHeaderResponse response)protected HeaderItemwrapTinyMceSettingsScript(String settingScript, Component component)Wrap the initialization script for TinyMCE into a HeaderItem.-
Methods inherited from class org.apache.wicket.behavior.Behavior
afterRender, beforeRender, canCallListener, detach, getStatelessHint, isEnabled, isTemporary, onAttribute, onComponentTag, onConfigure, onEvent, onException, onRemove, onTag, unbind
-
-
-
-
Constructor Detail
-
TinyMceBehavior
public TinyMceBehavior()
-
TinyMceBehavior
public TinyMceBehavior(TinyMCESettings settings)
-
-
Method Detail
-
renderHead
public void renderHead(Component component, IHeaderResponse response)
- Specified by:
renderHeadin interfaceIComponentAwareHeaderContributor- Overrides:
renderHeadin classBehavior
-
wrapTinyMceSettingsScript
protected HeaderItem wrapTinyMceSettingsScript(String settingScript, Component component)
Wrap the initialization script for TinyMCE into a HeaderItem. In this way we can control when and how the script should be executed.- Parameters:
settingScript- the actual initialization script for TinyMCEcomponent- the target component that must be decorated with TinyMCE- Returns:
- the HeaderItem containing
-
getAddTinyMceSettingsScript
protected String getAddTinyMceSettingsScript(TinyMCESettings.Mode mode, Collection<Component> components)
-
isMarkupIdRequired
protected boolean isMarkupIdRequired()
-
getComponent
protected Component getComponent()
-
getTinyMCEReference
protected ResourceReference getTinyMCEReference()
TinyMCE javascript resource.
Note: The TinyMCE source cannot be lazily loaded via ajax. Therefore, adding this in a
IHeaderContributor.renderHead(IHeaderResponse)must be done in a component that is not rendered via Ajax. If you wish to load this via Ajax, you can use the very hacky workaround#lazyLoadTinyMCEResource(IHeaderResponse).- Returns:
-
-