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();
  • 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:
    • 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.