private static final long serialVersionUID = 1L;
public FullFeaturedTinyMCEPage()
{
TinyMCESettings settings = new TinyMCESettings(TinyMCESettings.Theme.modern);
String plugins = "advlist autolink autosave link image lists charmap print preview hr anchor pagebreak spellchecker " +
"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking " +
"table contextmenu directionality emoticons template textcolor paste fullpage textcolor";
String[] pluginNames = plugins.split(" ");
for (String name : pluginNames)
{
settings.addPlugins(name);
}
settings.setMenuBar(false);
settings.addToolbar(new Toolbar("toolbar1",
"newdocument fullpage | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | styleselect formatselect fontselect fontsizeselect"));
settings.addToolbar(new Toolbar("toolbar2",
"cut copy paste | searchreplace | bullist numlist | outdent indent blockquote | undo redo | link unlink anchor image media code | inserttime preview | forecolor backcolor"));
settings.addToolbar(new Toolbar("toolbar3",
"table | hr removeformat | subscript superscript | charmap emoticons | print fullscreen | ltr rtl | spellchecker | visualchars visualblocks nonbreaking template pagebreak restoredraft"));
// custom settings
String styleFormats = "style_formats : ["
+ "{title : 'Bold text', inline : 'b'},"
+ "{title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},"
+ "{title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},"
+ "{title : 'Example 1', inline : 'span', classes : 'example1'},"
+ "{title : 'Example 2', inline : 'span', classes : 'example2'},"
+ "{title : 'Table styles'},"
+ "{title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}]";
settings.addCustomSetting(styleFormats);
//settings.addCustomSetting("content_css : \"../../../../../content.css\"");
TextArea<String> textArea = new TextArea<String>("ta", new Model<String>(TEXT));
textArea.add(new TinyMceBehavior(settings));