The css stylesheet that should style TinyMCE editor can be added this way (the css file should be placed in the same package as the java class):
TextArea ta = new TextArea("ta");
TinyMCESettings settings = new TinyMCESettings(TinyMCESettings.Theme.advanced);
ResourceReference cssRef = new CssResourceReference(this.getClass(), "tinymce.css");
settings.setContentCss(cssRef);
ta.add(new TinyMceBehavior(settings));
Full example:
Java
public class TinyMCEPage extends WebPage {
public TinyMCEPage() {
TextArea ta = new TextArea("ta");
TinyMCESettings settings = new TinyMCESettings(TinyMCESettings.Theme.advanced);
ResourceReference cssRef = new CssResourceReference(this.getClass(), "tinymce.css");
settings.setContentCss(cssRef);
ta.add(new TinyMceBehavior(settings));
add(ta);
}
}
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<textarea wicket:id="ta" id="ta" name="ta"></textarea>
</body>
</html>
To style e.g. width and height of the TinyMCE editor use id of the textarea (it should be specified in file "style.css" - file that styles the html page):
#ta {
width: 800px;
height: 600px;
}
To style the typing area of the TinyMCE editor e.g. font-size, color, ..., use the resource file (in this example file "tinymce.css") and css selector body:
body {
font-size: 14px;
background-color: #ffeedd;
border: 1px solid #333;
}
This example was tested using: wicket.version 6.17.0 and wicketstuff-tinymce version 6.16.0.