wicket.contrib.tinymce4
Class TinyMceBehavior

java.lang.Object
  extended by org.apache.wicket.behavior.Behavior
      extended by wicket.contrib.tinymce4.TinyMceBehavior
All Implemented Interfaces:
Serializable, org.apache.wicket.IComponentAwareEventSink, org.apache.wicket.markup.html.IComponentAwareHeaderContributor, org.apache.wicket.util.io.IClusterable

public class TinyMceBehavior
extends org.apache.wicket.behavior.Behavior

Renders a component (textarea) as WYSIWYG editor, using TinyMce.

See Also:
Serialized Form

Constructor Summary
TinyMceBehavior()
           
TinyMceBehavior(TinyMCESettings settings)
           
 
Method Summary
 void bind(org.apache.wicket.Component component)
           
protected  String getAddTinyMceSettingsScript(TinyMCESettings.Mode mode, Collection<org.apache.wicket.Component> components)
           
protected  org.apache.wicket.Component getComponent()
           
protected  org.apache.wicket.request.resource.ResourceReference getTinyMCEReference()
           TinyMCE javascript resource.
protected  boolean isMarkupIdRequired()
           
 void renderHead(org.apache.wicket.Component component, org.apache.wicket.markup.head.IHeaderResponse response)
           
protected  org.apache.wicket.markup.head.HeaderItem wrapTinyMceSettingsScript(String settingScript, org.apache.wicket.Component component)
          Wrap the initialization script for TinyMCE into a HeaderItem.
 
Methods inherited from class org.apache.wicket.behavior.Behavior
afterRender, beforeRender, canCallListenerInterface, detach, getStatelessHint, isEnabled, isTemporary, onComponentTag, onConfigure, onEvent, onException, onRemove, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TinyMceBehavior

public TinyMceBehavior()

TinyMceBehavior

public TinyMceBehavior(TinyMCESettings settings)
Method Detail

renderHead

public void renderHead(org.apache.wicket.Component component,
                       org.apache.wicket.markup.head.IHeaderResponse response)
Specified by:
renderHead in interface org.apache.wicket.markup.html.IComponentAwareHeaderContributor
Overrides:
renderHead in class org.apache.wicket.behavior.Behavior

wrapTinyMceSettingsScript

protected org.apache.wicket.markup.head.HeaderItem wrapTinyMceSettingsScript(String settingScript,
                                                                             org.apache.wicket.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 TinyMCE
component - the target component that must be decorated with TinyMCE
Returns:
the HeaderItem containing

getAddTinyMceSettingsScript

protected String getAddTinyMceSettingsScript(TinyMCESettings.Mode mode,
                                             Collection<org.apache.wicket.Component> components)

bind

public void bind(org.apache.wicket.Component component)
Overrides:
bind in class org.apache.wicket.behavior.Behavior

isMarkupIdRequired

protected boolean isMarkupIdRequired()

getComponent

protected org.apache.wicket.Component getComponent()

getTinyMCEReference

protected org.apache.wicket.request.resource.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:


Copyright © 2004–2018. All rights reserved.