Class VaadinCKEditorPremium
java.lang.Object
com.wontlost.ckeditor.VaadinCKEditorPremium
@NpmPackage(value="ckeditor5-premium-features",
version="47.4.0")
public final class VaadinCKEditorPremium
extends Object
Premium features enabler for VaadinCKEditor.
This class triggers the installation of the ckeditor5-premium-features npm package
when referenced in your application. Premium features require a valid license key from
ckeditor.com/pricing.
Usage:
// Step 1: Enable premium features (call once at application startup)
VaadinCKEditorPremium.enable();
// Step 2: Use premium plugins in your editor
VaadinCKEditor editor = VaadinCKEditor.create()
.withPreset(CKEditorPreset.FULL)
.withLicenseKey("your-license-key") // Required for premium features
.addCustomPlugin(CustomPlugin.fromPremium("ExportPdf"))
.addCustomPlugin(CustomPlugin.fromPremium("ExportWord"))
.addCustomPlugin(CustomPlugin.fromPremium("FormatPainter"))
.withToolbar("exportPdf", "exportWord", "formatPainter", "|", "bold", "italic")
.build();
Available Premium Plugins:
| Plugin | Toolbar Item | Description |
|---|---|---|
| ExportPdf | exportPdf | Export content to PDF |
| ExportWord | exportWord | Export content to Word (DOCX) |
| ImportWord | importWord | Import Word documents |
| FormatPainter | formatPainter | Copy and apply formatting |
| CaseChange | caseChange | Change text case |
| SlashCommand | - | Slash command menu (type /) |
| TableOfContents | tableOfContents | Auto-generated TOC |
| DocumentOutline | - | Document structure outline |
| Template | insertTemplate | Content templates |
| MergeFields | insertMergeField | Mail merge fields |
| Pagination | - | Page breaks and pagination |
| AIAssistant | aiCommands, aiAssistant | AI-powered writing assistant |
| Comments | comment | Inline commenting |
| TrackChanges | trackChanges | Track document changes |
| RevisionHistory | revisionHistory | Version history |
| LineHeight | lineHeight | Line height adjustment |
License:
Premium features require a commercial license. You can:
- Start a 14-day free trial at ckeditor.com/pricing
- Purchase a subscription (Essential, Professional, or Enterprise plans)
Best Practices:
- Store the license key in environment variables, not in source code
- Configure domain whitelist in the CKEditor Portal for production
- Call
enable()in your Application class or main view
// Recommended: Load license key from environment
String licenseKey = System.getenv("CKEDITOR_LICENSE_KEY");
editor.withLicenseKey(licenseKey);
- Since:
- 5.0.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration of all available premium plugins. -
Method Summary
-
Method Details
-
enable
public static boolean enable()Ensures the premium npm package is included in the Vaadin build.The actual npm installation is handled by the
@NpmPackageannotation on this class. Calling this method forces the class to be loaded, which makes Vaadin's annotation scanner pick up the annotation. Without this call the class may be pruned by dead-code elimination since nothing else references it.This method is idempotent - calling it multiple times has no additional effect.
Example:
@SpringBootApplication public class Application implements AppShellConfigurator { public static void main(String[] args) { VaadinCKEditorPremium.enable(); // Trigger class loading for @NpmPackage SpringApplication.run(Application.class, args); } }- Returns:
trueif this call enabled premium features,falseif already enabled
-
isEnabled
public static boolean isEnabled()Checks if premium features have been enabled.- Returns:
trueifenable()has been called,falseotherwise
-
getVersion
Returns the version of the ckeditor5-premium-features package.- Returns:
- the npm package version
-