|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwicket.contrib.tinymce.settings.TinyMCESettings
public class TinyMCESettings
Settings class for TinyMCE editor. User can add/remove buttons, enable/disable resizing, change positions, orientation, alignment and much more.
Plugin
,
Button
,
Serialized FormNested Class Summary | |
---|---|
static class |
TinyMCESettings.Align
This class enables you to specify the alignment of the controls. |
static class |
TinyMCESettings.EntityEncoding
Controls how entities/characters get processed by TinyMCE. |
static class |
TinyMCESettings.Language
Language enum |
static class |
TinyMCESettings.Location
This option enables you to specify where the toolbar should be located. |
static class |
TinyMCESettings.Mode
This class specifies how elements is to be converted into TinyMCE WYSIWYG editor instances. |
static class |
TinyMCESettings.Position
This class specifies the position of new added control. |
static class |
TinyMCESettings.Theme
This class enables you to specify what theme to use when rendering the TinyMCE WYSIWYG editor instances. |
static class |
TinyMCESettings.Toolbar
This class specifices the toolbar to add specific control to. |
Field Summary | |
---|---|
static Set<TinyMCESettings.Language> |
languages
|
static ResourceReference |
REFERENCE
|
static ResourceReference |
REFERENCE_MIN
|
Constructor Summary | |
---|---|
TinyMCESettings()
|
|
TinyMCESettings(TinyMCESettings.Theme theme)
|
|
TinyMCESettings(TinyMCESettings.Theme theme,
TinyMCESettings.Language lang)
|
Method Summary | |
---|---|
void |
add(Button button,
TinyMCESettings.Toolbar toolbar,
TinyMCESettings.Position position)
Add a default button to tinymce editor. |
void |
addCustomSetting(String customSetting)
|
void |
disableButton(Button button)
Disable specific button in advanced theme mode. |
String |
getAdditionalPluginJavaScript()
Get additional javascript from the plugins. |
boolean |
getAutoResize()
Deprecated. |
String |
getBlockFormats()
|
ResourceReference |
getContentCss()
|
Boolean |
getConvertUrls()
|
String[] |
getCustomSettings()
|
String |
getDocumentBaseUrl()
|
TinyMCESettings.EntityEncoding |
getEntityEncoding()
|
boolean |
getHorizontalResizing()
|
TinyMCESettings.Language |
getLanguage()
|
String |
getLoadPluginJavaScript()
|
Boolean |
getRelativeUrls()
|
Boolean |
getRemoveScriptHost()
|
boolean |
getResizing()
|
boolean |
getResizingUseCookie()
|
TinyMCESettings.Location |
getStatusbarLocation()
|
TinyMCESettings.Theme |
getTheme()
|
TinyMCESettings.Align |
getToolbarAlign()
|
List<Button> |
getToolbarButtons(TinyMCESettings.Toolbar toolbar)
|
TinyMCESettings.Location |
getToolbarLocation()
|
boolean |
isReadOnly()
|
static ResourceReference |
javaScriptReference()
TinyMCE javascript resource. |
static void |
lazyLoadTinyMCEResource(org.apache.wicket.markup.head.IHeaderResponse response)
Normally, TinyMCE cannot be natively loaded lazily; you must have the 'tiny_mce.js' script rendered directly to your page instead of through an Ajax loaded component. |
void |
register(Plugin plugin)
Register a tinymce plugin. |
void |
setAutoResize(boolean auto_resize)
Deprecated. |
void |
setBlockFormats(String blockFormats)
|
void |
setContentCss(ResourceReference contentCss)
|
void |
setConvertUrls(boolean convertUrls)
This option enables you to control if TinyMCE is to be clever and restore urls to their original values. |
void |
setDocumentBaseUrl(String documentBaseUrl)
|
void |
setEntityEncoding(TinyMCESettings.EntityEncoding entityEncoding)
|
void |
setHorizontalResizing(boolean horizontalResizing)
|
void |
setReadOnly(boolean readOnly)
|
void |
setRelativeUrls(Boolean relativeUrls)
If this option is set to true, all URLs returned from the MCFileManager will be relative from the specified document_base_url. |
void |
setRemoveScriptHost(Boolean removeScriptHost)
If this option is enabled the protocol and host part of the URLs returned from the MCFileManager will be removed. |
void |
setResizing(boolean resizing)
|
void |
setResizingUseCookie(boolean resizingUseCookie)
|
void |
setStatusbarLocation(TinyMCESettings.Location statusbarLocation)
|
void |
setToolbarAlign(TinyMCESettings.Align toolbarAlign)
|
void |
setToolbarButtons(TinyMCESettings.Toolbar toolbar,
List<Button> buttons)
This option can only be used when theme is set to advanced and when the theme_advanced_layout_manager option is set to the default value of "SimpleLayout". |
void |
setToolbarLocation(TinyMCESettings.Location toolbarLocation)
|
String |
toJavaScript(TinyMCESettings.Mode mode,
Collection<Component> components)
Generates the initialisation script. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ResourceReference REFERENCE
public static final ResourceReference REFERENCE_MIN
public static final Set<TinyMCESettings.Language> languages
Constructor Detail |
---|
public TinyMCESettings()
public TinyMCESettings(TinyMCESettings.Theme theme)
public TinyMCESettings(TinyMCESettings.Theme theme, TinyMCESettings.Language lang)
Method Detail |
---|
public TinyMCESettings.Theme getTheme()
public TinyMCESettings.Language getLanguage()
public String getDocumentBaseUrl()
public void setDocumentBaseUrl(String documentBaseUrl)
public void addCustomSetting(String customSetting)
public String[] getCustomSettings()
public ResourceReference getContentCss()
public void setContentCss(ResourceReference contentCss)
@Deprecated public boolean getAutoResize()
@Deprecated public void setAutoResize(boolean auto_resize)
AutoResizePlugin
in TinyMCE v.3.2.5
auto_resize
- public String getBlockFormats()
public void setBlockFormats(String blockFormats)
public void setToolbarLocation(TinyMCESettings.Location toolbarLocation)
public TinyMCESettings.Location getToolbarLocation()
public void setStatusbarLocation(TinyMCESettings.Location statusbarLocation)
public TinyMCESettings.Location getStatusbarLocation()
public void setToolbarAlign(TinyMCESettings.Align toolbarAlign)
public TinyMCESettings.Align getToolbarAlign()
public void setEntityEncoding(TinyMCESettings.EntityEncoding entityEncoding)
public TinyMCESettings.EntityEncoding getEntityEncoding()
public void setReadOnly(boolean readOnly)
public boolean isReadOnly()
public void setResizing(boolean resizing)
public boolean getResizing()
public void setHorizontalResizing(boolean horizontalResizing)
public boolean getHorizontalResizing()
public boolean getResizingUseCookie()
public void setResizingUseCookie(boolean resizingUseCookie)
public void setConvertUrls(boolean convertUrls)
convertUrls
- public Boolean getConvertUrls()
public void setRemoveScriptHost(Boolean removeScriptHost)
removeScriptHost
- public Boolean getRemoveScriptHost()
public void setRelativeUrls(Boolean relativeUrls)
relativeUrls
- public Boolean getRelativeUrls()
public void add(Button button, TinyMCESettings.Toolbar toolbar, TinyMCESettings.Position position)
button
- - button to be addedtoolbar
- - the toolbar where to add this button toposition
- - position of this buttonpublic void disableButton(Button button)
button
- button to be disabledpublic void setToolbarButtons(TinyMCESettings.Toolbar toolbar, List<Button> buttons)
toolbar
- the toolbar to define buttons forbuttons
- A list of buttons to show as that toolbar. An empty list will remove (make
invisible) the toolbar in tinymce. Passing null will remove the setting for the
toolbar.public List<Button> getToolbarButtons(TinyMCESettings.Toolbar toolbar)
toolbar
- The toolbar to return the defined buttons for
public void register(Plugin plugin)
plugin
- public final String toJavaScript(TinyMCESettings.Mode mode, Collection<Component> components)
public String getLoadPluginJavaScript()
public String getAdditionalPluginJavaScript()
public static ResourceReference javaScriptReference()
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)
.
public static void lazyLoadTinyMCEResource(org.apache.wicket.markup.head.IHeaderResponse response)
Normally, TinyMCE cannot be natively loaded lazily; you must have the 'tiny_mce.js' script rendered directly to your page instead of through an Ajax loaded component. This method provides a workaround similar to the one described on:
http://tinymce.moxiecode.com/forum/viewtopic.php?pid=66531#p66531
Presumably, before you encountered this method, you had:
public void renderHead(IHeaderResponse response) { response.renderJavascriptReference(TinyMCESettings.javaScriptReference()); }
in some component that resided on the page before the panel that loaded the textarea (with TinyMCEBehavior) via ajax. Now, that panel can simply call:
public void renderHead(IHeaderResponse response) { TinyMCESettings.lazyLoadTinyMCEResource(response); }TODO: This has not been extensively tested.
response
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |