com.jalios.jcms.policy
Class BasicWysiwygPolicyFilter

java.lang.Object
  extended by com.jalios.jcms.policy.AbstractPolicyFilter
      extended by com.jalios.jcms.policy.BasicWysiwygPolicyFilter
All Implemented Interfaces:
PluginComponent, PolicyFilter, WysiwygPolicyFilter, Comparable

public class BasicWysiwygPolicyFilter
extends AbstractPolicyFilter
implements WysiwygPolicyFilter, PluginComponent

This class allow users to customize behaviour of widgets by re-writing call-back methods.

Since:
jcms-5.5.0
Version:
$Revision: 19809 $
Author:
Jean-Philippe Encausse
See Also:
WidgetPolicyFilter

Field Summary
static String REVISION
           
 
Fields inherited from class com.jalios.jcms.policy.AbstractPolicyFilter
order
 
Constructor Summary
BasicWysiwygPolicyFilter()
           
 
Method Summary
 String afterRendering(String text, Locale userLocale)
          This method is called after wysiwyg rendering
 String beforeRendering(String text, Locale userLocale)
          This method is called before wysiwyg rendering
 void checkGlobalWysiwygCSS(Set globalStyle, Workspace workspace)
          This method is a hook called by Workspace to manage wysiwyg css global style to display.
 void checkLocalWysiwygCSS(Set localStyle, String globalStyle, Workspace workspace)
          This method is a hook called by Workspace to manage wysiwyg css local style to display.
 void checkWysiwygCSSFile(Set cssFileSet)
          This method is a hook called by Workspace to manage wysiwyg css files to parse and to display in wysiwyg css bar.
 boolean init(Plugin plugin)
          Initialize the component with the given plugin configuration
 boolean loadWysiwygEditor(JcmsJspContext context, boolean load)
          This method is a hook called by JcmsJspContext to fill the JavaScript headers with the javascript files required to provide the WYSIWYG editor.
 
Methods inherited from class com.jalios.jcms.policy.AbstractPolicyFilter
compareTo, equals, getOrder, setOrder
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values
Constructor Detail

BasicWysiwygPolicyFilter

public BasicWysiwygPolicyFilter()
Method Detail

init

public boolean init(Plugin plugin)
Description copied from interface: PluginComponent
Initialize the component with the given plugin configuration

Specified by:
init in interface PluginComponent
Parameters:
plugin - the calling plugin
Returns:
true if the component has been correctly initialized.
Since:
jcms-5.7.1
See Also:
PluginComponent.init(Plugin)

loadWysiwygEditor

public boolean loadWysiwygEditor(JcmsJspContext context,
                                 boolean load)
Description copied from interface: WysiwygPolicyFilter
This method is a hook called by JcmsJspContext to fill the JavaScript headers with the javascript files required to provide the WYSIWYG editor.

Specified by:
loadWysiwygEditor in interface WysiwygPolicyFilter
Parameters:
context - the JcmsJspContext for which the check should be made.
load - the value computed by JCMS, true if the wysiwyg's javascript files need to be included, false otherwise.
Returns:
true when the wysiwyg's javascript files are to be included, false otherwise.
You should not modify this method to return false when the load argument was computed to true as you will prevent the editor to be loaded where it is needed by default.
See Also:
WysiwygPolicyFilter.loadWysiwygEditor(JcmsJspContext, boolean)

checkWysiwygCSSFile

public void checkWysiwygCSSFile(Set cssFileSet)
Description copied from interface: WysiwygPolicyFilter
This method is a hook called by Workspace to manage wysiwyg css files to parse and to display in wysiwyg css bar.

Specified by:
checkWysiwygCSSFile in interface WysiwygPolicyFilter
Parameters:
cssFileSet - the path of CSSFile to work with
See Also:
WysiwygPolicyFilter.checkWysiwygCSSFile(Set)

checkGlobalWysiwygCSS

public void checkGlobalWysiwygCSS(Set globalStyle,
                                  Workspace workspace)
Description copied from interface: WysiwygPolicyFilter
This method is a hook called by Workspace to manage wysiwyg css global style to display.

Specified by:
checkGlobalWysiwygCSS in interface WysiwygPolicyFilter
Parameters:
globalStyle - Set of global style
workspace - the current Workspace
See Also:
WysiwygPolicyFilter.checkGlobalWysiwygCSS(Set, Workspace)

checkLocalWysiwygCSS

public void checkLocalWysiwygCSS(Set localStyle,
                                 String globalStyle,
                                 Workspace workspace)
Description copied from interface: WysiwygPolicyFilter
This method is a hook called by Workspace to manage wysiwyg css local style to display.

Specified by:
checkLocalWysiwygCSS in interface WysiwygPolicyFilter
Parameters:
localStyle - Set of local style
globalStyle - the chosen global style
workspace - the current Workspace
See Also:
WysiwygPolicyFilter.checkLocalWysiwygCSS(Set, String, Workspace)

beforeRendering

public String beforeRendering(String text,
                              Locale userLocale)
Description copied from interface: WysiwygPolicyFilter
This method is called before wysiwyg rendering

Specified by:
beforeRendering in interface WysiwygPolicyFilter
Parameters:
text - the text to be rendered.
userLocale - an optionnal Locale of the user for which the text will be generated
Returns:
the text.
See Also:
WysiwygPolicyFilter.beforeRendering(String, Locale)

afterRendering

public String afterRendering(String text,
                             Locale userLocale)
Description copied from interface: WysiwygPolicyFilter
This method is called after wysiwyg rendering

Specified by:
afterRendering in interface WysiwygPolicyFilter
Parameters:
text - the text after the rendering.
userLocale - an optionnal Locale of the user for which the text will be generated
Returns:
the text.
See Also:
WysiwygPolicyFilter.afterRendering(String, Locale)


Copyright © 2001-2010 Jalios SA. All Rights Reserved.