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:

PluginToolbar ItemDescription
ExportPdfexportPdfExport content to PDF
ExportWordexportWordExport content to Word (DOCX)
ImportWordimportWordImport Word documents
FormatPainterformatPainterCopy and apply formatting
CaseChangecaseChangeChange text case
SlashCommand-Slash command menu (type /)
TableOfContentstableOfContentsAuto-generated TOC
DocumentOutline-Document structure outline
TemplateinsertTemplateContent templates
MergeFieldsinsertMergeFieldMail merge fields
Pagination-Page breaks and pagination
AIAssistantaiCommands, aiAssistantAI-powered writing assistant
CommentscommentInline commenting
TrackChangestrackChangesTrack document changes
RevisionHistoryrevisionHistoryVersion history
LineHeightlineHeightLine 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:
  • 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 @NpmPackage annotation 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:
      true if this call enabled premium features, false if already enabled
    • isEnabled

      public static boolean isEnabled()
      Checks if premium features have been enabled.
      Returns:
      true if enable() has been called, false otherwise
    • getVersion

      public static String getVersion()
      Returns the version of the ckeditor5-premium-features package.
      Returns:
      the npm package version