Package org.silverpeas.core.web.util
Class WysiwygEditorConfig
- java.lang.Object
-
- org.silverpeas.core.web.util.WysiwygEditorConfig
-
public class WysiwygEditorConfig extends Object
Configuration of the WYSIWYG editor. It depends on the implementation of such an editor. Currently it depends on the CKEditor.- Author:
- mmoquillon
-
-
Constructor Summary
Constructors Constructor Description WysiwygEditorConfig(String componentName)
Constructs a WYSIWYG editor configuration for the specified component.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WysiwygEditorConfig
copy()
String
getComponentId()
String
getHeight()
Gets the height of the edition area.String
getLanguage()
Gets the localization to use by the editor.String
getObjectId()
String
getServerURL()
Gets the URL of the server in which is running Silverpeas.String
getSkin()
Gets the skin by default to use with the editor.List<String>
getStylesheets()
Gets the stylesheets to apply to the editor.String
getToolbar()
Gets the name of the toolbar definition to use by the editor.String
getWidth()
Gets the width of the edition area.void
setComponentId(String componentId)
void
setFileBrowserDisplayed(boolean fileBrowserDisplayed)
Indicates if the file browser must be displayed in the editor.void
setHeight(String height)
Sets the height of the edition area.void
setLanguage(String language)
Sets the localization to use by the editor.void
setObjectId(String objectId)
void
setStylesheet(String stylesheet)
Sets a custom stylesheet to render the editor in a peculiar way.void
setToolbar(String toolbar)
Sets the name of the toolbar definition to use by the editor.void
setToolbarStartExpanded(boolean toolbarStartExpanded)
Indicates if the toolbar must be started with its toolbar expanded.void
setWidth(String width)
Sets the width of the edition area.String
toJSON()
Gets a JSON representation of this configuration in order to be used in the Javascript land.
-
-
-
Constructor Detail
-
WysiwygEditorConfig
public WysiwygEditorConfig(String componentName)
Constructs a WYSIWYG editor configuration for the specified component. According to the component, a peculiar configuration can be used for that component instead of default.- Parameters:
componentName
- the name of the component starting with a lower case for which the editor has to be initialized.
-
-
Method Detail
-
toJSON
public String toJSON()
Gets a JSON representation of this configuration in order to be used in the Javascript land.- Returns:
- a JSON representation of this configuration.
-
getStylesheets
public List<String> getStylesheets()
Gets the stylesheets to apply to the editor. By default, only the standard CSS of Silverpeas is used except for some predefined Silverpeas applications for which either an additional CSS is also used or no CSS has to be applied.- Returns:
- a list of stylesheets to apply to the editor.
-
getSkin
public String getSkin()
Gets the skin by default to use with the editor. It is a value coming from the settings inproperties/org/silverpeas/wysiwyg/settings/wysiwygSettings.properties
.- Returns:
- the name of the skin to use.
-
getHeight
public String getHeight()
Gets the height of the edition area.- Returns:
- the edition area height.
-
setHeight
public void setHeight(String height)
Sets the height of the edition area.- Parameters:
height
- the edition area height.
-
getWidth
public String getWidth()
Gets the width of the edition area.- Returns:
- the edition area width.
-
setWidth
public void setWidth(String width)
Sets the width of the edition area.- Parameters:
width
- the edition area width.
-
getLanguage
public String getLanguage()
Gets the localization to use by the editor.- Returns:
- the localization code in ISO 631-1
-
setLanguage
public void setLanguage(String language)
Sets the localization to use by the editor.- Parameters:
language
- the localization code in ISO 631-1
-
getToolbar
public String getToolbar()
Gets the name of the toolbar definition to use by the editor. By default "Default".- Returns:
- the toolbar definition name.
-
setToolbar
public void setToolbar(String toolbar)
Sets the name of the toolbar definition to use by the editor.- Parameters:
toolbar
- the toolbar definition name.
-
setStylesheet
public void setStylesheet(String stylesheet)
Sets a custom stylesheet to render the editor in a peculiar way. By default, the current look stylesheet is used (that is no custom stylesheet is set).- Parameters:
stylesheet
- a custom stylesheet.
-
setToolbarStartExpanded
public void setToolbarStartExpanded(boolean toolbarStartExpanded)
Indicates if the toolbar must be started with its toolbar expanded.- Parameters:
toolbarStartExpanded
- true if the toolbar must be expanded at the editor startup, false otherwise.
-
getServerURL
public String getServerURL()
Gets the URL of the server in which is running Silverpeas. Either it is taken by the Silverpeas configuration or it is computed from the current HTTP request.- Returns:
- the URL of the server.
-
setFileBrowserDisplayed
public void setFileBrowserDisplayed(boolean fileBrowserDisplayed)
Indicates if the file browser must be displayed in the editor.- Parameters:
fileBrowserDisplayed
- true if it has been displayed, false otherwise.
-
getComponentId
public String getComponentId()
-
setComponentId
public void setComponentId(String componentId)
-
getObjectId
public String getObjectId()
-
setObjectId
public void setObjectId(String objectId)
-
copy
public WysiwygEditorConfig copy()
-
-