Library Spotlight

Spotlight: TinyMCE Rich Text Editor

Add powerful rich text editing to your Oorian applications with TinyMCE.

M. WarbleJune 4, 20262 min read
Spotlight: TinyMCE Rich Text Editor

TinyMCE is one of the most trusted rich text editors on the web, used by millions of sites. Oorian's wrapper makes it easy to add professional content editing to your applications.

Basic Editor Setup

TmceEditor editor = new TmceEditor();
editor.setHeight("400px");
editor.setValue("<p>Start typing here...</p>");
body.addElement(editor);

Configuring the Toolbar

TmceEditor editor = new TmceEditor();

editor.setToolbar(
    "undo redo | formatselect | " +
    "bold italic underline strikethrough | " +
    "alignleft aligncenter alignright alignjustify | " +
    "bullist numlist outdent indent | " +
    "link image table | removeformat"
);

editor.setPlugins("lists", "link", "image", "table");
body.addElement(editor);

Getting and Setting Content

// Get content
String html = editor.getContent();

// Set content
editor.setContent("<h1>Welcome</h1><p>This is new content.</p>");

// Handle content changes
editor.registerListener(this, ContentChangeEvent.class);

@Override
public void onEvent(ContentChangeEvent event)
{
    String content = event.getContent();
    autoSave(content);
}

Image Uploads

editor.setImagesUploadHandler(new ImageUploadHandler()
{
    @Override
    public String handleUpload(byte[] imageData, String filename)
    {
        // Save to storage and return URL
        String url = storageService.saveImage(imageData, filename);
        return url;
    }
});

Custom Styles

editor.setContentCss("/css/editor-content.css");

editor.setStyleFormats(
    new StyleFormat("Highlight", "span", "highlight"),
    new StyleFormat("Code Block", "pre", "code-block")
);

Read-Only Mode

// For viewing content without editing
editor.setReadOnly(true);

// Toggle editing
public void enableEditing()
{
    editor.setReadOnly(false);
}

Conclusion

TinyMCE integration brings professional content editing to Oorian. Configure toolbars, handle uploads, and manage content—all through Java code.

Related Articles

Security

Security by Default: How Oorian Protects Your Applications

January 11, 2026
Announcement

Why We Built Oorian: The Story Behind the Framework

January 7, 2026
Tutorial

Getting Started with Oorian: Your First Java Web Application

December 31, 2025