Enum Class CKEditorPreset

java.lang.Object
java.lang.Enum<CKEditorPreset>
com.wontlost.ckeditor.CKEditorPreset
All Implemented Interfaces:
Serializable, Comparable<CKEditorPreset>, Constable

public enum CKEditorPreset extends Enum<CKEditorPreset>
CKEditor preset configurations. Provides common plugin combinations for quick setup.

Usage example:

 // Use a preset
 VaadinCKEditor.create()
     .withPreset(CKEditorPreset.STANDARD)
     .build();

 // Customize based on preset
 VaadinCKEditor.create()
     .withPreset(CKEditorPreset.BASIC)
     .addPlugin(CKEditorPlugin.TABLE)
     .build();
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    AI Document preset (~900KB, requires Premium license) Full document editor with AI-powered writing assistant.
    Basic preset (~300KB) Suitable for simple text input, comments
    Collaborative preset (requires Premium license) Base configuration for collaborative editing with Comments, Track Changes, and Revision History.
    Document preset (~800KB) Suitable for professional document editing
    Email preset (~500KB, requires Premium license) Optimized for composing professional emails and email templates.
    Empty preset For fully custom configuration
    Full preset (~700KB) Suitable for complete document processing Optimized for fast loading (~40 plugins)
    Notion-like preset (~900KB, requires Premium license) Block-based editor with collaborative features, slash commands, and balloon toolbar.
    Standard preset (~600KB) Suitable for general document editing, blogs
  • Method Summary

    Modifier and Type
    Method
    Description
    Get default toolbar configuration
    Get display name
    int
    Get estimated bundle size (KB).
    Get plugins included in this preset
    boolean
    Check if preset includes a specific plugin
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • BASIC

      public static final CKEditorPreset BASIC
      Basic preset (~300KB) Suitable for simple text input, comments
    • STANDARD

      public static final CKEditorPreset STANDARD
      Standard preset (~600KB) Suitable for general document editing, blogs
    • FULL

      public static final CKEditorPreset FULL
      Full preset (~700KB) Suitable for complete document processing Optimized for fast loading (~40 plugins)
    • DOCUMENT

      public static final CKEditorPreset DOCUMENT
      Document preset (~800KB) Suitable for professional document editing
    • COLLABORATIVE

      public static final CKEditorPreset COLLABORATIVE
      Collaborative preset (requires Premium license) Base configuration for collaborative editing with Comments, Track Changes, and Revision History.

      Important: This preset only includes the base plugins. You must add the collaboration plugins separately using CustomPlugin.fromPremium():

       // Asynchronous collaboration (Comments, Track Changes)
       VaadinCKEditor editor = VaadinCKEditor.create()
           .withPreset(CKEditorPreset.COLLABORATIVE)
           .withLicenseKey("your-license-key")
           .addCustomPlugin(CustomPlugin.fromPremium("Comments"))
           .addCustomPlugin(CustomPlugin.fromPremium("TrackChanges"))
           .addCustomPlugin(CustomPlugin.fromPremium("RevisionHistory"))
           .build();
      
       // Real-time collaboration (requires CKEditor Cloud Services)
       VaadinCKEditor editor = VaadinCKEditor.create()
           .withPreset(CKEditorPreset.COLLABORATIVE)
           .withLicenseKey("your-license-key")
           .addCustomPlugin(CustomPlugin.fromPremium("RealTimeCollaborativeEditing"))
           .addCustomPlugin(CustomPlugin.fromPremium("RealTimeCollaborativeComments"))
           .addCustomPlugin(CustomPlugin.fromPremium("PresenceList"))
           .withConfig(config -> config
               .set("cloudServices.tokenUrl", "https://your-server/token")
               .set("collaboration.channelId", "document-123")
           )
           .build();
       

      Available collaboration plugins:

      • Comments - Add comments to document fragments
      • TrackChanges - Track all changes as suggestions
      • RevisionHistory - Document version control
      • RealTimeCollaborativeEditing - Real-time co-editing
      • RealTimeCollaborativeComments - Real-time comments sync
      • RealTimeCollaborativeTrackChanges - Real-time track changes sync
      • RealTimeCollaborativeRevisionHistory - Real-time revision sync
      • PresenceList - Show connected users
      See Also:
    • AI_DOCUMENT

      public static final CKEditorPreset AI_DOCUMENT
      AI Document preset (~900KB, requires Premium license) Full document editor with AI-powered writing assistant.

      This preset includes all document editing plugins plus AI integration. AI plugins must be added separately using CustomPlugin.fromPremium():

       VaadinCKEditor editor = VaadinCKEditor.create()
           .withPreset(CKEditorPreset.AI_DOCUMENT)
           .withLicenseKey("your-license-key")
           .addCustomPlugin(CustomPlugin.fromPremium("AIChat"))
           .addCustomPlugin(CustomPlugin.fromPremium("AIEditorIntegration"))
           .addCustomPlugin(CustomPlugin.fromPremium("AIQuickActions"))
           .addCustomPlugin(CustomPlugin.fromPremium("AIReviewMode"))
           .addCustomPlugin(CustomPlugin.fromPremium("AITranslate"))
           .build();
       
    • EMAIL

      public static final CKEditorPreset EMAIL
      Email preset (~500KB, requires Premium license) Optimized for composing professional emails and email templates.

      Email-specific features must be added via premium plugins. When adding premium plugins, also add their corresponding toolbar items:

       VaadinCKEditor editor = VaadinCKEditor.create()
           .withPreset(CKEditorPreset.EMAIL)
           .withLicenseKey("your-license-key")
           .addCustomPlugin(CustomPlugin.fromPremium("EmailConfigurationHelper"))
           .addCustomPlugin(CustomPlugin.fromPremium("ExportInlineStyles"))
           .addCustomPlugin(CustomPlugin.fromPremium("SourceEditingEnhanced"))
           .addCustomPlugin(CustomPlugin.fromPremium("MergeFields"))
           .addCustomPlugin(CustomPlugin.fromPremium("Template"))
           .addCustomPlugin(CustomPlugin.fromPremium("PasteFromOfficeEnhanced"))
           .addCustomPlugin(CustomPlugin.fromPremium("TableLayout"))
           // Add premium toolbar items:
           .withToolbar("undo", "redo", "|",
               "insertMergeField", "previewMergeFields", "|",
               "sourceEditingEnhanced", "|",
               "heading", "style", "|",
               "fontSize", "fontFamily", "fontColor", "fontBackgroundColor", "|",
               "bold", "italic", "underline", "|",
               "link", "insertImage", "insertTable", "insertTableLayout", "|",
               "alignment", "|",
               "bulletedList", "numberedList", "outdent", "indent")
           .build();
       
    • NOTION

      public static final CKEditorPreset NOTION
      Notion-like preset (~900KB, requires Premium license) Block-based editor with collaborative features, slash commands, and balloon toolbar.

      Collaboration and productivity plugins must be added separately. When adding premium plugins, also add their corresponding toolbar items:

       VaadinCKEditor editor = VaadinCKEditor.create()
           .withPreset(CKEditorPreset.NOTION)
           .withLicenseKey("your-license-key")
           .addCustomPlugin(CustomPlugin.fromPremium("SlashCommand"))
           .addCustomPlugin(CustomPlugin.fromPremium("CaseChange"))
           .addCustomPlugin(CustomPlugin.fromPremium("Template"))
           .addCustomPlugin(CustomPlugin.fromPremium("TableOfContents"))
           .addCustomPlugin(CustomPlugin.fromPremium("ExportPdf"))
           .addCustomPlugin(CustomPlugin.fromPremium("ExportWord"))
           .addCustomPlugin(CustomPlugin.fromPremium("ImportWord"))
           .addCustomPlugin(CustomPlugin.fromPremium("PasteFromOfficeEnhanced"))
           .addCustomPlugin(CustomPlugin.fromPremium("Comments"))
           .addCustomPlugin(CustomPlugin.fromPremium("TrackChanges"))
           .addCustomPlugin(CustomPlugin.fromPremium("RevisionHistory"))
           // Add premium toolbar items:
           .withToolbar("undo", "redo", "|",
               "revisionHistory", "trackChanges", "comment", "commentsArchive", "|",
               "importWord", "exportWord", "exportPdf", "caseChange", "findAndReplace", "|",
               "heading", "|",
               "bold", "italic", "underline", "strikethrough", "code", "|",
               "emoji", "specialCharacters", "horizontalLine",
               "link", "insertImage", "mediaEmbed",
               "insertTable", "tableOfContents", "insertTemplate",
               "highlight", "blockQuote", "codeBlock", "|",
               "bulletedList", "numberedList", "todoList",
               "outdent", "indent")
           .build();
       
    • EMPTY

      public static final CKEditorPreset EMPTY
      Empty preset For fully custom configuration
  • Method Details

    • values

      public static CKEditorPreset[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CKEditorPreset valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getDisplayName

      public String getDisplayName()
      Get display name
    • getPlugins

      public Set<CKEditorPlugin> getPlugins()
      Get plugins included in this preset
    • getDefaultToolbar

      public String[] getDefaultToolbar()
      Get default toolbar configuration
    • hasPlugin

      public boolean hasPlugin(CKEditorPlugin plugin)
      Check if preset includes a specific plugin
    • getEstimatedSize

      public int getEstimatedSize()
      Get estimated bundle size (KB). Note: These are approximate values based on typical builds. Actual size depends on webpack/vite configuration and tree-shaking.